From: Eric Leblond Date: Mon, 8 Dec 2014 13:49:16 +0000 (+0100) Subject: unix-manager: fix cppcheck errors X-Git-Tag: suricata-2.1beta3~108 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f22c878e89ff91481c26f73539d03e42b44d08c;p=thirdparty%2Fsuricata.git unix-manager: fix cppcheck errors This patch fixes the following errors: [src/unix-manager.c:306]: (error) Memory pointed to by 'client' is freed twice. [src/unix-manager.c:313]: (error) Memory pointed to by 'client' is freed twice. [src/unix-manager.c:323]: (error) Memory pointed to by 'client' is freed twice. [src/unix-manager.c:334]: (error) Memory pointed to by 'client' is freed twice. Unix manager was treating the packet after closing the socket if message was too long. --- diff --git a/src/unix-manager.c b/src/unix-manager.c index 2d0a90641a..d28a7dac1d 100644 --- a/src/unix-manager.c +++ b/src/unix-manager.c @@ -297,6 +297,7 @@ int UnixCommandAccept(UnixCommand *this) SCLogInfo("Command server: client message is too long, " "disconnect him."); close(client); + return 0; } buffer[ret] = 0;