Przeglądaj źródła

Fix memory leak while working with konfd.

git-svn-id: https://klish.googlecode.com/svn/trunk@174 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 14 lat temu
rodzic
commit
dffa557ef3
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      clish/clish_config_callback.c

+ 3 - 1
clish/clish_config_callback.c

@@ -276,8 +276,10 @@ static int receive_answer(konf_client_t * client, konf_buf_t **data)
 			konf_buf_t *tmpdata = NULL;
 			retval = process_answer(client, str, buf, &tmpdata);
 			lub_string_free(str);
-			if (retval < 0)
+			if (retval < 0) {
+				konf_buf_delete(buf);
 				return retval;
+			}
 			if (retval == 0)
 				processed = 1;
 			if (tmpdata) {