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

@@ -299,6 +299,14 @@ Version 1.8.0
Version 1.6.16 Version 1.6.16
******************************************************************************* *******************************************************************************
2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
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.
2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com> 2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
HInfo->ServiceTable initialization in UpnpRegisterRootDevice2 and UpnpRegisterRootDevice4 HInfo->ServiceTable initialization in UpnpRegisterRootDevice2 and UpnpRegisterRootDevice4

View File

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