Skip to content
Snippets Groups Projects
Commit 51cb7273 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Close file descriptor in error condition

Fix CID 516461
parent 300d0c12
No related branches found
No related tags found
No related merge requests found
Pipeline #7435 passed
...@@ -673,6 +673,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, int mode, ...@@ -673,6 +673,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, int mode,
} }
length=(long)filelength(file); length=(long)filelength(file);
if(length < 0) { if(length < 0) {
close(file);
errormsg(WHERE, ERR_LEN, msgtmp, length); errormsg(WHERE, ERR_LEN, msgtmp, length);
free(buf); free(buf);
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment