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

[Libguestfs] [PATCH 1/3] Allow guestfs___free_string_list (NULL).



From: "Richard W.M. Jones" <rjones redhat com>

Equivalent to free (NULL).
---
 src/utils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/utils.c b/src/utils.c
index aaf4fa5..16b7d6b 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -30,6 +30,10 @@ void
 guestfs___free_string_list (char **argv)
 {
   size_t i;
+
+  if (argv == NULL)
+    return;
+
   for (i = 0; argv[i] != NULL; ++i)
     free (argv[i]);
   free (argv);
-- 
1.8.1


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