changeset 660:a842469ce8ad

- Fix minor leak
author Matt Johnston <matt@ucc.asn.au>
date Wed, 22 Feb 2012 22:05:24 +0800
parents 1e0414b29ce9
children c015af8a71cf
files svr-authpam.c
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/svr-authpam.c	Wed Feb 22 19:33:07 2012 +0800
+++ b/svr-authpam.c	Wed Feb 22 22:05:24 2012 +0800
@@ -56,11 +56,7 @@
 	struct UserDataS* userDatap = (struct UserDataS*) appdata_ptr;
 	unsigned int msg_len = 0;
 	unsigned int i = 0;
-
-	const char* message = (*msg)->msg;
-
-	/* make a copy we can strip */
-	char * compare_message = m_strdup(message);
+	char * compare_message = NULL;
 
 	TRACE(("enter pamConvFunc"))
 
@@ -71,15 +67,10 @@
 		dropbear_log(LOG_INFO, "pamConvFunc() called with >1 messages: not supported.");
 		return PAM_CONV_ERR;
 	}
+
+	/* make a copy we can strip */
+	compare_message = m_strdup((*msg)->msg);
 	
-	TRACE(("msg_style is %d", (*msg)->msg_style))
-	if (compare_message) {
-		TRACE(("message is '%s'", compare_message))
-	} else {
-		TRACE(("null message"))
-	}
-
-
 	/* Make the string lowercase. */
 	msg_len = strlen(compare_message);
 	for (i = 0; i < msg_len; i++) {