ctdb_conn: Fix a small memory leak when releasing an IP
authorVolker Lendecke <vl@samba.org>
Sat, 13 Sep 2014 18:06:45 +0000 (20:06 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 18 Sep 2014 18:36:11 +0000 (20:36 +0200)
We're exiting anyway, but when in the future we have multichannel this
might actually be a small leak.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/lib/ctdbd_conn.c

index 3ba8385adaf252109472eed58b3f9369105b17cf..a667482f6b2930bad46db094f3f8b2dc2a790dbf 100644 (file)
@@ -415,6 +415,8 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
                        DEBUG(10, ("received CTDB_SRVID_RELEASE_IP\n"));
                        ret = conn->release_ip_handler((const char *)msg->data,
                                                       conn->release_ip_priv);
                        DEBUG(10, ("received CTDB_SRVID_RELEASE_IP\n"));
                        ret = conn->release_ip_handler((const char *)msg->data,
                                                       conn->release_ip_priv);
+                       TALLOC_FREE(hdr);
+
                        if (ret) {
                                /*
                                 * We need to release the ip,
                        if (ret) {
                                /*
                                 * We need to release the ip,
@@ -426,7 +428,6 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
                                conn->release_ip_priv = NULL;
                                return NT_STATUS_ADDRESS_CLOSED;
                        }
                                conn->release_ip_priv = NULL;
                                return NT_STATUS_ADDRESS_CLOSED;
                        }
-                       TALLOC_FREE(hdr);
                        goto next_pkt;
                }
 
                        goto next_pkt;
                }