From: Andre Noll <maan@systemlinux.org>
Date: Fri, 13 Jan 2012 22:43:05 +0000 (+0100)
Subject: audioc: Do not leak command buffer.
X-Git-Tag: v0.4.10~8^2~2
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=d73a140ae7f77a18f858a66d1a354d106088c6ca;p=paraslash.git

audioc: Do not leak command buffer.

This buffer contains the command to be sent to para_audiod. It is
allocated but never freed.
---

diff --git a/audioc.c b/audioc.c
index 5f928889..64152ce0 100644
--- a/audioc.c
+++ b/audioc.c
@@ -284,7 +284,7 @@ static char *configfile_exists(void)
 int main(int argc, char *argv[])
 {
 	int ret = -E_AUDIOC_SYNTAX, fd;
-	char *cf, *buf = NULL, *args;
+	char *cf, *buf = NULL, *args = NULL;
 	size_t bufsize;
 
 	if (audioc_cmdline_parser(argc, argv, &conf))
@@ -345,6 +345,7 @@ int main(int argc, char *argv[])
 	} while (ret >= 0);
 out:
 	free(buf);
+	free(args);
 	if (ret < 0)
 		PARA_ERROR_LOG("%s\n", para_strerror(-ret));
 	return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;