Code

utils_cache: Free then unused memory before returning in an error condition.
authorSebastian Harl <sh@tokkee.org>
Tue, 20 Jan 2009 12:24:54 +0000 (13:24 +0100)
committerSebastian Harl <sh@tokkee.org>
Tue, 20 Jan 2009 12:24:54 +0000 (13:24 +0100)
src/utils_cache.c

index 6779bba86c829ddd25bb9e3b0802bf7d7f0a43e9..793841213f7d07e5464e230b00d3de9247a3d352 100644 (file)
@@ -187,6 +187,7 @@ static int uc_insert (const data_set_t *ds, const value_list_t *vl,
   ce = cache_alloc (ds->ds_num);
   if (ce == NULL)
   {
+    sfree (key_copy);
     ERROR ("uc_insert: cache_alloc (%i) failed.", ds->ds_num);
     return (-1);
   }