diff mbox

cifs.upcall: fix crash when trying to free uninitialized var

Message ID 1294241851-10013-1-git-send-email-jlayton@samba.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Jan. 5, 2011, 3:37 p.m. UTC
None
diff mbox

Patch

diff --git a/cifs.upcall.c b/cifs.upcall.c
index 1ffcd7c..34b0638 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -677,6 +677,7 @@  int main(const int argc, char *const argv[])
 	const char *oid;
 
 	hostbuf[0] = '\0';
+	memset(&arg, 0, sizeof(arg));
 
 	openlog(prog, 0, LOG_DAEMON);
 
@@ -731,8 +732,6 @@  int main(const int argc, char *const argv[])
 		goto out;
 	}
 
-	memset(&arg, 0, sizeof(arg));
-
 	have = decode_key_description(buf, &arg);
 	SAFE_FREE(buf);
 	if ((have & DKD_MUSTHAVE_SET) != DKD_MUSTHAVE_SET) {