Fixed memory leak in collectdclient library.
[collectd.git] / src / libcollectdclient / client.c
index 63d4e9d..2f427a8 100644 (file)
@@ -746,6 +746,8 @@ int lcc_getval (lcc_connection_t *c, lcc_identifier_t *ident, /* {{{ */
   if (ret_values_names != NULL)
     *ret_values_names = values_names;
 
+  lcc_response_free (&res);
+
   return (0);
 } /* }}} int lcc_getval */
 
@@ -777,9 +779,9 @@ int lcc_putval (lcc_connection_t *c, const lcc_value_list_t *vl) /* {{{ */
     SSTRCATF (command, " interval=%i", vl->interval);
 
   if (vl->time > 0)
-    SSTRCATF (command, "%u", (unsigned int) vl->time);
+    SSTRCATF (command, " %u", (unsigned int) vl->time);
   else
-    SSTRCAT (command, "N");
+    SSTRCAT (command, " N");
 
   for (i = 0; i < vl->values_len; i++)
   {