r22382: fix memory leak
authorStefan Metzmacher <metze@samba.org>
Thu, 19 Apr 2007 17:00:15 +0000 (17:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:51:11 +0000 (14:51 -0500)
metze

source/wrepl_server/wrepl_server.c

index bc24ae1abdb62de241fbe9ca2b60ca4b46a39acf..f7ad7cf284c746bb4d871f3d6146fc182026377d 100644 (file)
@@ -127,7 +127,7 @@ NTSTATUS wreplsrv_load_partners(struct wreplsrv_service *service)
        struct wreplsrv_partner *partner;
        struct ldb_result *res = NULL;
        int ret;
        struct wreplsrv_partner *partner;
        struct ldb_result *res = NULL;
        int ret;
-       TALLOC_CTX *tmp_ctx = talloc_new(service);
+       TALLOC_CTX *tmp_ctx;
        int i;
        uint64_t new_seqnumber;
 
        int i;
        uint64_t new_seqnumber;
 
@@ -138,6 +138,9 @@ NTSTATUS wreplsrv_load_partners(struct wreplsrv_service *service)
                return NT_STATUS_OK;
        }
 
                return NT_STATUS_OK;
        }
 
+       tmp_ctx = talloc_new(service);
+       NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
+
        service->config.seqnumber = new_seqnumber;
 
        /* find the record in the WINS database */
        service->config.seqnumber = new_seqnumber;
 
        /* find the record in the WINS database */