Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8ed4576 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Gerrit Code Review
Browse files

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
parent f22626cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;