[parted-devel] [PATCH 4/7] parted: Free tmp usage inside do_print

Brian C. Lane bcl at redhat.com
Fri Jun 11 21:51:22 BST 2021


str_list_create calls gettext_to_wchar which makes a copy of it.
---
 parted/parted.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/parted/parted.c b/parted/parted.c
index e9aa240..ba152c3 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1192,6 +1192,7 @@ do_print (PedDevice** dev, PedDisk** diskp)
                             sprintf (tmp, "%2s ", "");
 
                     StrList *row = str_list_create (tmp, NULL);
+                    free(tmp);
 
                     start = ped_unit_format (*dev, part->geom.start);
                     end = ped_unit_format_byte (
-- 
2.31.1




More information about the parted-devel mailing list