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

[augeas-devel] [PATCH] * src/lens.c (lens_release): allow NULL lens to be passed in



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

diff --git a/src/lens.c b/src/lens.c
index 07f44cb..295baef 100644
--- a/src/lens.c
+++ b/src/lens.c
@@ -696,6 +696,8 @@ void free_lens(struct lens *lens) {
 }
 
 void lens_release(struct lens *lens) {
+    if (lens == NULL)
+        return;
     regexp_release(lens->ctype);
     regexp_release(lens->atype);
     if (lens->tag == L_KEY || lens->tag == L_STORE)
-- 
1.6.0.6



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