From: Michal Privoznik Date: Thu, 22 Oct 2020 10:55:40 +0000 (+0200) Subject: parthelper: Don't leak @canonical_path X-Git-Tag: v6.9.0-rc1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db8e747af98df732aff67eca9fb67514310359bf;p=thirdparty%2Flibvirt.git parthelper: Don't leak @canonical_path The @canonical_path variable holds canonicalized path passed as argv[1]. The canonicalized path is obtained either via virFileResolveLink() or plain g_strdup(). Nevertheless, in both cases it must be freed. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c index 29a01d3dd5..caa2e8fa62 100644 --- a/src/storage/parthelper.c +++ b/src/storage/parthelper.c @@ -62,7 +62,7 @@ int main(int argc, char **argv) PedPartition *part; int cmd = DISK_LAYOUT; const char *path; - char *canonical_path; + g_autofree char *canonical_path = NULL; const char *partsep; bool devmap_partsep = false;