From 7a988d489cd4f5540e07ef30a0ca0dfb534caceb Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 30 Jul 2014 09:46:48 -0600 Subject: [PATCH] It is now sudo_efree() not efree(). Don't try to free a pointer to garbage on error. --- src/sudo_edit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sudo_edit.c b/src/sudo_edit.c index af67b9393..d46d16ae7 100644 --- a/src/sudo_edit.c +++ b/src/sudo_edit.c @@ -88,7 +88,7 @@ sudo_edit(struct command_details *command_details) struct command_details saved_command_details; ssize_t nread, nwritten; const char *tmpdir; - char *cp, *suff, **nargv, **ap, **files = NULL; + char *cp, *suff, **nargv = NULL, **ap, **files = NULL; char buf[BUFSIZ]; int rc, i, j, ac, ofd, tfd, nargc, rval, tmplen; int editor_argc = 0, nfiles = 0; @@ -333,8 +333,8 @@ sudo_edit(struct command_details *command_details) } close(ofd); } - efree(tf); - efree(nargv); + sudo_efree(tf); + sudo_efree(nargv); debug_return_int(rval); cleanup: @@ -345,8 +345,8 @@ cleanup: unlink(tf[i].tfile); } } - efree(tf); - efree(nargv); + sudo_efree(tf); + sudo_efree(nargv); debug_return_int(1); }