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:
Love Hörnquist Åstrand
2005-10-22 13:15:43 +00:00
parent f74a40ff85
commit 9dccedb6d3
3 changed files with 61 additions and 24 deletions

View File

@@ -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",