SF Bug Tracker id 3497009 - Resource leak in http_SendMessage

Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-05 05:51:44 PST

Fp is not closed if fseeko(Fp, Instr->RangeOffset, SEEK_CUR) does not return 0.
(cherry picked from commit 5caaf3ad07)
This commit is contained in:
Fabrice Fontaine
2012-03-05 15:53:20 +01:00
committed by Marcelo Roberto Jimenez
parent b5061149a6
commit a0951e3753
2 changed files with 10 additions and 2 deletions

View File

@@ -462,12 +462,12 @@ int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt, ...)
if (virtualDirCallback.seek(Fp, Instr->RangeOffset,
SEEK_CUR) != 0) {
RetVal = UPNP_E_FILE_READ_ERROR;
goto ExitFunction;
goto Cleanup_File;
}
} else if (Instr && Instr->IsRangeActive) {
if (fseeko(Fp, Instr->RangeOffset, SEEK_CUR) != 0) {
RetVal = UPNP_E_FILE_READ_ERROR;
goto ExitFunction;
goto Cleanup_File;
}
}
while (amount_to_be_read) {