Fixing memory leak in retrieve_manifests

This commit fixes a memory leak with the dir variable.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit is contained in:
Castulo Martinez
2018-10-03 15:41:27 -07:00
committed by Otavio Pontes
parent c9ee84c70c
commit f7ef320b6a
+2 -2
View File
@@ -447,7 +447,7 @@ static int retrieve_manifests(int current, int version, char *component, struct
{
char *url = NULL;
char *filename;
char *dir;
char *dir = NULL;
char *basedir;
int ret = 0;
struct stat sb;
@@ -504,7 +504,6 @@ static int retrieve_manifests(int current, int version, char *component, struct
untar:
ret = extract_to(filename, dir);
free_string(&dir);
if (ret != 0) {
goto out;
} else {
@@ -514,6 +513,7 @@ untar:
}
out:
free_string(&dir);
free_string(&filename);
free_string(&url);
return ret;