[gnome-builder] libeditorconfig: fix utarray leak



commit 12c0f6523b600570b62cacf42129e72242a2239d
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Tue Oct 25 15:55:49 2016 +0200

    libeditorconfig: fix utarray leak

 contrib/libeditorconfig/ec_glob.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/contrib/libeditorconfig/ec_glob.c b/contrib/libeditorconfig/ec_glob.c
index 5dcfe9c..71106cf 100644
--- a/contrib/libeditorconfig/ec_glob.c
+++ b/contrib/libeditorconfig/ec_glob.c
@@ -315,7 +315,10 @@ int ec_glob(const char *pattern, const char *string)
     re = pcre_compile(pcre_str, 0, &error_msg, &erroffset, NULL);
 
     if (!re)        /* failed to compile */
-        return -1;
+    {
+      utarray_free(nums);
+      return -1;
+    }
 
     pcre_result_len = 3 * (utarray_len(nums) + 1);
     pcre_result = (int *) calloc(pcre_result_len, sizeof(int_pair));


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