]> granicus.if.org Git - p11-kit/commitdiff
rpc: Fix memleak in rpc_socket cleanup
authorDaiki Ueno <dueno@redhat.com>
Wed, 21 Sep 2016 13:06:41 +0000 (15:06 +0200)
committerDaiki Ueno <ueno@gnu.org>
Mon, 31 Oct 2016 11:59:17 +0000 (12:59 +0100)
GCC's asan spotted this:
  Direct leak of 120 byte(s) in 1 object(s) allocated from:
      #0 0x7f8d4f221fe0 in calloc (/lib64/libasan.so.3+0xc6fe0)
      #1 0x427f55 in rpc_socket_new ../p11-kit/rpc-transport.c:100
      #2 0x42bc1b in rpc_exec_connect ../p11-kit/rpc-transport.c:767

p11-kit/rpc-transport.c

index 5251e11695c9b3c8cbd5e7fa6bcc4545a511f2c3..13d13727a60260c97073e05063a802ce6c281c39 100644 (file)
@@ -163,6 +163,7 @@ rpc_socket_unref (rpc_socket *sock)
        rpc_socket_close (sock);
        p11_mutex_uninit (&sock->write_lock);
        p11_mutex_uninit (&sock->read_lock);
+       free (sock);
 }
 
 static bool