mirror of
https://github.com/troglobit/finit.git
synced 2026-11-24 20:21:44 +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)
|
if (found == -1)
|
||||||
return 1;
|
goto notfound;
|
||||||
|
|
||||||
*fac = found;
|
*fac = found;
|
||||||
prio = ptr;
|
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;
|
return 1;
|
||||||
|
}
|
||||||
*lvl = found;
|
*lvl = found;
|
||||||
|
|
||||||
if (duparg != arg)
|
if (duparg)
|
||||||
free(duparg);
|
free(duparg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user