Fix double-free and memory leak in RTSP option parsing failure path
This commit is contained in:
parent
454fdccffc
commit
957b1de1ad
1 changed files with 1 additions and 2 deletions
|
|
@ -159,7 +159,6 @@ int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
|
|||
// Create a new node containing the option and content
|
||||
newOpt = (POPTION_ITEM)malloc(sizeof(OPTION_ITEM));
|
||||
if (newOpt == NULL) {
|
||||
freeOptionList(options);
|
||||
exitCode = RTSP_ERROR_NO_MEMORY;
|
||||
goto ExitFailure;
|
||||
}
|
||||
|
|
@ -221,7 +220,7 @@ int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
|
|||
|
||||
ExitFailure:
|
||||
if (options) {
|
||||
free(options);
|
||||
freeOptionList(options);
|
||||
}
|
||||
if (messageBuffer) {
|
||||
free(messageBuffer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue