]> Kevux Git Server - fll/commitdiff
Security: Fix memory leak.
authorKevin Day <thekevinday@gmail.com>
Wed, 15 Dec 2021 02:19:16 +0000 (20:19 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 15 Dec 2021 02:19:16 +0000 (20:19 -0600)
Objects are allocated and only deallocated on error.
On success, they are not deallocated and leaks memory when out of scope of the block.

level_3/fake/c/private-make.c

index 19774b3b8b2854f13cf2fc5de3a4cc7457e196f3..d75f9535911c75ad8f1c12c331c1506c73cb1d9c 100644 (file)
@@ -245,9 +245,10 @@ extern "C" {
         }
       }
 
+      macro_f_fss_delimits_t_delete_simple(delimits);
+      macro_f_fss_comments_t_delete_simple(comments);
+
       if (F_status_is_error(*status)) {
-        macro_f_fss_delimits_t_delete_simple(delimits);
-        macro_f_fss_comments_t_delete_simple(comments);
         macro_f_fss_objects_t_delete_simple(list_objects);
         macro_f_fss_contents_t_delete_simple(list_contents);