[augeas-devel] [PATCH 2/8] regexp_release: allow NULL regexp

David Lutterkort lutter at redhat.com
Mon Aug 31 21:44:28 UTC 2009


---
 src/regexp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/regexp.c b/src/regexp.c
index 179d7c1..d3414cd 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -328,7 +328,7 @@ int regexp_nsub(struct regexp *r) {
 }
 
 void regexp_release(struct regexp *regexp) {
-    if (regexp->re != NULL) {
+    if (regexp != NULL && regexp->re != NULL) {
         regfree(regexp->re);
         FREE(regexp->re);
     }
-- 
1.6.2.5




More information about the augeas-devel mailing list