[glib] Regex leak on error path



commit e8a42bb81c46204a86259e44aa9698658487e64a
Author: Paolo Borelli <pborelli katamail com>
Date:   Fri Apr 3 00:04:39 2009 -0400

    Regex leak on error path
    
    Don't leak the GRegex struct when g_regex_new() fails.
---
 glib/gregex.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/glib/gregex.c b/glib/gregex.c
index f92f0a9..091b418 100644
--- a/glib/gregex.c
+++ b/glib/gregex.c
@@ -1199,6 +1199,8 @@ g_regex_new (const gchar         *pattern,
                                            regex->pattern,
                                            errmsg);
           g_propagate_error (error, tmp_error);
+
+          g_regex_unref (regex);
           return NULL;
 	}
     }



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