swrap: Do not leak buf in swrap_sendmsg()
authorAndreas Schneider <asn@samba.org>
Thu, 21 Mar 2019 13:59:30 +0000 (14:59 +0100)
committerAndreas Schneider <asn@samba.org>
Thu, 21 Mar 2019 14:00:48 +0000 (15:00 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
src/socket_wrapper.c

index 5b82e0c5c390374e4917c96720330694f3281a51..a9e2a756fded28ddcac93956a6513a4a20d60476 100644 (file)
@@ -5910,6 +5910,7 @@ static ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags)
 
                swrap_dir = socket_wrapper_dir();
                if (swrap_dir == NULL) {
+                       free(buf);
                        return -1;
                }