[PATCH] Free memory on error

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed Sep 18 00:17:58 CEST 2013


Hi,

Here is a patch to correct a memory leak when an error occurs.

Best Regards
  Alistair Leslie-Hughes
-------------- next part --------------
>From 2b929c698e93c61fbee6fee567389e9fdfcca137 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Wed, 4 Sep 2013 16:50:14 +1000
Subject: [PATCH] Free memory on error

---
 source4/libnet/libnet_site.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index 5a58c8a..67b8016 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -65,6 +65,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li
 	if (ret != 0) {
 		r->out.error_string = NULL;
 		status = map_nt_error_from_unix_common(errno);
+		talloc_free(tmp_ctx);
 		return status;
 	}
 
-- 
1.8.1.2



More information about the samba-technical mailing list