Imported Upstream version 3.2.1
[debian/amanda] / client-src / client_util.c
index 5dc4974f8f31dd586f8f2f79468af9eb53e4a8ab..d7387e852b4ebf84f4f66474db6a53539ac27fb9 100644 (file)
@@ -66,6 +66,13 @@ fixup_relative(
     return newname;
 }
 
+/* GDestroyFunc for a hash table whose values are GSLists contianing malloc'd
+ * strings */
+static void
+destroy_slist_free_full(gpointer list) {
+    slist_free_full((GSList *)list, g_free);
+}
+
 
 static char *
 get_name(
@@ -1009,7 +1016,7 @@ run_client_script(
     script->result = g_new0(client_script_result_t, 1);
     script->result->proplist =
                  g_hash_table_new_full(g_str_hash, g_str_equal,
-                                       &g_free, &g_slist_free_full_gpointer);
+                                       &g_free, &destroy_slist_free_full);
     script->result->output = g_ptr_array_new();
     script->result->err = g_ptr_array_new();
 
@@ -1221,7 +1228,6 @@ run_client_scripts(
            g_ptr_array_free(script->result->err, TRUE);
            script->result->err = NULL;
        }
-       amfree(script->result);
     }
 }