[PATCH] Minor fix on regex.c

"Franck LAMASUTA" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
I'm working on a new patch for smsc_http.c and I found a memory leak in regex.c...

Franck
regex_leak.patch (application/octet-stream, 559 B)
Index: regex.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/regex.c,v
retrieving revision 1.13
diff -u -r1.13 regex.c
--- regex.c	12 Jan 2009 16:46:53 -0000	1.13
+++ regex.c	27 Jun 2009 09:33:37 -0000
@@ -107,6 +107,7 @@
         error(0, "%s:%ld: %s: regex compilation `%s' failed: %s (Called from %s:%ld:%s.)",
               __FILE__, (long) __LINE__, __func__, octstr_get_cstr(pattern), buffer, 
               (file), (long) (line), (func));
+        gw_free(preg);
         return NULL;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.