[gobject-introspection] tests: Free input array in test_array_int_inout()



commit cf713559de494229d6104bd98883f49c0ff1f663
Author: Simon Feltman <sfeltman src gnome org>
Date:   Thu Sep 11 17:16:07 2014 -0700

    tests: Free input array in test_array_int_inout()
    
    Transfer is annotated as full so the function should free its input.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736517

 tests/scanner/regress.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 59dafaa..c05bae2 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -664,6 +664,8 @@ regress_test_array_int_inout (int *n_ints, int **ints)
       new_ints = g_malloc(sizeof(**ints) * *n_ints);
       for (i = 0; i < *n_ints; i++)
        new_ints[i] = (*ints)[i + 1] + 1;
+
+      g_free (*ints);
       *ints = new_ints;
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]