mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-07 14:11:52 +00:00
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:
committed by
Otavio Pontes
parent
c9ee84c70c
commit
f7ef320b6a
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user