config: iniparser 3.x fix: Remove needless **keys allocation 73/228373/1
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 20 Mar 2020 17:06:06 +0000 (18:06 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 20 Mar 2020 17:08:47 +0000 (18:08 +0100)
Change-Id: I823d77c9a16584d7eb04b4c5c8d0e242f0d7c865

src/shared/config.c

index 285c4a8..b3bce77 100644 (file)
@@ -63,16 +63,16 @@ static int config_load_exclude_paths(config_t *c, dictionary *ini)
        if (n <= 0)
                return 0;
 
-       char **keys = alloca(sizeof(char *) * n);
        int total = n + c->n_exclude_paths;
        int n_added = 0;
 
        c->exclude_paths = realloc(c->exclude_paths, sizeof(char *) * total);
 
-       if (!keys || !c->exclude_paths)
+       if (!c->exclude_paths)
                goto err_oom;
 
-       keys = iniparser_getseckeys(ini, EXCLUDEPATHS_SECTION);
+       // keys are destroyed by iniparser
+       char **keys = iniparser_getseckeys(ini, EXCLUDEPATHS_SECTION);
        if (!keys)
                goto err_oom;