From 1789666b13d830b97f7b95fa5296ecc4fb199b22 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 21 Apr 2017 21:22:34 +0200 Subject: [PATCH] audioc: Avoid double free in audioc_i9e_line_handler(). If connect_audiod() returns negative, we free "args" twice. Found by the clang static analyzer. --- audioc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/audioc.c b/audioc.c index f2e20bab..38a8db5d 100644 --- a/audioc.c +++ b/audioc.c @@ -200,7 +200,7 @@ static int audioc_i9e_line_handler(char *line) ret = connect_audiod(socket_name, args); free(args); if (ret < 0) - goto out; + return ret; at->fd = ret; ret = mark_fd_nonblocking(at->fd); if (ret < 0) @@ -217,8 +217,6 @@ static int audioc_i9e_line_handler(char *line) return 1; close: close(at->fd); -out: - free(args); return ret; } -- 2.39.5