Blob Blame History Raw
From: Bogdan-Andrei Iancu <bogdan@opensips.org>
Date: Tue, 26 Jan 2016 18:39:00 +0200
Subject: [PATCH] Fixed wrong warning on memory leak.

Set the auth_hdr buffer to NULL after moving the buffer into the lump.
Reported by Colin Martin on mailing list

(cherry picked from commit bbaf8213ae9856d2345aa66d8aa002ec5f1f3fa5)

diff --git a/modules/uac/auth.c b/modules/uac/auth.c
index c7c367d..69de12d 100644
--- a/modules/uac/auth.c
+++ b/modules/uac/auth.c
@@ -183,6 +183,9 @@ int uac_auth( struct sip_msg *msg)
 		new_hdr->s = NULL; new_hdr->len = 0;
 		goto error;
 	}
+	/* the Authorization hdr was already pushed into the message as a lump
+	 * along with the buffer, so detach the buffer from new_hdr var */
+	new_hdr->s = NULL; new_hdr->len = 0;
 
 	new_hdr->s = NULL; new_hdr->len = 0;
 	return 0;