]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unix-manager: fix cppcheck errors
authorEric Leblond <eric@regit.org>
Mon, 8 Dec 2014 13:49:16 +0000 (14:49 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 11 Dec 2014 10:50:28 +0000 (11:50 +0100)
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.

src/unix-manager.c

index 2d0a90641aa5e2ca6e1bb9e2f2623409e71d9558..d28a7dac1d40a7d21d7e00fddb89d20300d6f77a 100644 (file)
@@ -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;