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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2020-10-22 12:55:40 +02:00
parent 3b8deb9603
commit db8e747af9

View File

@ -62,7 +62,7 @@ int main(int argc, char **argv)
PedPartition *part; PedPartition *part;
int cmd = DISK_LAYOUT; int cmd = DISK_LAYOUT;
const char *path; const char *path;
char *canonical_path; g_autofree char *canonical_path = NULL;
const char *partsep; const char *partsep;
bool devmap_partsep = false; bool devmap_partsep = false;