From: Todd C. Miller Date: Tue, 20 Dec 2011 18:50:48 +0000 (-0500) Subject: Quiet a bogus gcc warning. X-Git-Tag: SUDO_1_8_4~98^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7799d01cfa497804d70463c64f1494cf93190f17;p=sudo Quiet a bogus gcc warning. --- diff --git a/src/sudo_edit.c b/src/sudo_edit.c index 1568219f7..16c705790 100644 --- a/src/sudo_edit.c +++ b/src/sudo_edit.c @@ -100,7 +100,7 @@ sudo_edit(struct command_details *command_details) char *ofile; struct timeval omtim; off_t osize; - } *tf; + } *tf = NULL; debug_decl(sudo_edit, SUDO_DEBUG_EDIT) /* @@ -324,9 +324,11 @@ sudo_edit(struct command_details *command_details) cleanup: /* Clean up temp files and return. */ - for (i = 0; i < nfiles; i++) { - if (tf[i].tfile != NULL) - unlink(tf[i].tfile); + if (tf != NULL) { + for (i = 0; i < nfiles; i++) { + if (tf[i].tfile != NULL) + unlink(tf[i].tfile); + } } debug_return_int(1); }