Check return value from asprintf instead of string != NULL since it
undefined behavior on Linux. From Björn Sandell git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16216 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -121,7 +121,8 @@ exec_shell(const char *shell, int fallback)
|
||||
p++;
|
||||
else
|
||||
p = shell;
|
||||
asprintf(&sh, "-%s", p);
|
||||
if (asprintf(&sh, "-%s", p) == -1)
|
||||
errx(1, "Out of memory");
|
||||
execle(shell, sh, NULL, env);
|
||||
if(fallback){
|
||||
warnx("Can't exec %s, trying %s",
|
||||
|
Reference in New Issue
Block a user