It is now sudo_efree() not efree().
Don't try to free a pointer to garbage on error.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user