Skip to contentSkip to conversation

fix strdup() return value check

PATCH New Leonardo Chiquitto 1 participant 1 message Dec 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix strdup() return value check

Ian,

Please consider the following patch.

Thanks,
Leonardo

autofs-5.0.5 - fix strdup() return value check

Fix copy and paste error when checking strdup() return value, originally reported by David Binderman in:

http://bugzilla.novell.com/show_bug.cgi?id=523348

lib/defaults.c +1 -1
Index: autofs/lib/defaults.c
===================================================================
@@ -65,7 +65,7 @@ static char *get_env_string(const char *
 		return NULL;
 
 	res = strdup(val);
-	if (!val)
+	if (!res)
 		return NULL;
 
 	return res;