chiark / gitweb /
strv: fix three minor OOM-triggered memory leaks
authorLennart Poettering <lennart@poettering.net>
Sun, 14 Feb 2010 21:37:30 +0000 (22:37 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 14 Feb 2010 21:37:30 +0000 (22:37 +0100)
strv.c

diff --git a/strv.c b/strv.c
index c4880c4..25ea92c 100644 (file)
--- a/strv.c
+++ b/strv.c
@@ -163,6 +163,8 @@ fail:
         for (k--; k >= r; k--)
                 free(*k);
 
+        free(r);
+
         return NULL;
 }
 
@@ -191,6 +193,8 @@ fail:
         for (k--; k >= r; k--)
                 free(*k);
 
+        free(r);
+
         return NULL;
 
 }
@@ -305,6 +309,8 @@ fail:
         for (k--; k >= r; k--)
                 free(*k);
 
+        free(r);
+
         return NULL;
 }