It is now sudo_efree() not efree().

Don't try to free a pointer to garbage on error.
This commit is contained in:
Todd C. Miller
2014-07-30 09:46:48 -06:00
parent 080d0e650f
commit 7a988d489c

View File

@@ -88,7 +88,7 @@ sudo_edit(struct command_details *command_details)
struct command_details saved_command_details; struct command_details saved_command_details;
ssize_t nread, nwritten; ssize_t nread, nwritten;
const char *tmpdir; const char *tmpdir;
char *cp, *suff, **nargv, **ap, **files = NULL; char *cp, *suff, **nargv = NULL, **ap, **files = NULL;
char buf[BUFSIZ]; char buf[BUFSIZ];
int rc, i, j, ac, ofd, tfd, nargc, rval, tmplen; int rc, i, j, ac, ofd, tfd, nargc, rval, tmplen;
int editor_argc = 0, nfiles = 0; int editor_argc = 0, nfiles = 0;
@@ -333,8 +333,8 @@ sudo_edit(struct command_details *command_details)
} }
close(ofd); close(ofd);
} }
efree(tf); sudo_efree(tf);
efree(nargv); sudo_efree(nargv);
debug_return_int(rval); debug_return_int(rval);
cleanup: cleanup:
@@ -345,8 +345,8 @@ cleanup:
unlink(tf[i].tfile); unlink(tf[i].tfile);
} }
} }
efree(tf); sudo_efree(tf);
efree(nargv); sudo_efree(nargv);
debug_return_int(1); debug_return_int(1);
} }