mirror of
https://github.com/troglobit/finit.git
synced 2026-10-15 10:29:35 +00:00
logit: fix minor (possible) memory leak
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 file changed
+7
-3
+7
-3
@@ -164,7 +164,7 @@ static int parse_prio(char *arg, int *fac, int *lvl)
|
||||
}
|
||||
|
||||
if (found == -1)
|
||||
return 1;
|
||||
goto notfound;
|
||||
|
||||
*fac = found;
|
||||
prio = ptr;
|
||||
@@ -179,11 +179,15 @@ static int parse_prio(char *arg, int *fac, int *lvl)
|
||||
}
|
||||
}
|
||||
|
||||
if (found == -1)
|
||||
if (found == -1) {
|
||||
notfound:
|
||||
if (duparg)
|
||||
free(duparg);
|
||||
return 1;
|
||||
}
|
||||
*lvl = found;
|
||||
|
||||
if (duparg != arg)
|
||||
if (duparg)
|
||||
free(duparg);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user