diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-08-26 15:33:11 +0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-08-26 15:09:41 +0000 |
commit | a8ed457694adb68e4da0309291d8f870677e6237 (patch) | |
tree | b6ccec63bf6f8fd998554b614696deaf3ce55a5a /roots.c | |
parent | f22626cdbecfe27c96f205710173458eab14e1a1 (diff) | |
download | android_bootable_recovery-a8ed457694adb68e4da0309291d8f870677e6237.tar.gz android_bootable_recovery-a8ed457694adb68e4da0309291d8f870677e6237.tar.bz2 android_bootable_recovery-a8ed457694adb68e4da0309291d8f870677e6237.zip |
recovery: don't overallocate for get_android_secure_path
We simply need the space to fill both strings and a final null.
a char pointer is a lot larger than a char ;)
Change-Id: I3472e1a9978fb2f6d439d4af9c072a98cec0cd19
Diffstat (limited to 'roots.c')
-rw-r--r-- | roots.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -132,7 +132,7 @@ char** get_extra_storage_paths() { static char* android_secure_path = NULL; char* get_android_secure_path() { if (android_secure_path == NULL) { - android_secure_path = malloc((17 + strlen(get_primary_storage_path())) * sizeof(char *)); + android_secure_path = malloc(sizeof("/.android_secure") + strlen(get_primary_storage_path()) + 1); sprintf(android_secure_path, "%s/.android_secure", primary_storage_path); } return android_secure_path; |