aboutsummaryrefslogtreecommitdiffstats
path: root/roots.c
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-08-26 15:33:11 +0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-08-26 15:09:41 +0000
commita8ed457694adb68e4da0309291d8f870677e6237 (patch)
treeb6ccec63bf6f8fd998554b614696deaf3ce55a5a /roots.c
parentf22626cdbecfe27c96f205710173458eab14e1a1 (diff)
downloadandroid_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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/roots.c b/roots.c
index 314b173c..5d86c1f0 100644
--- a/roots.c
+++ b/roots.c
@@ -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;