mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-16 22:00:55 +00:00
Fix double-free and memory leak in RTSP option parsing failure path
This commit is contained in:
+1
-2
@@ -159,7 +159,6 @@ int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
|
|||||||
// Create a new node containing the option and content
|
// Create a new node containing the option and content
|
||||||
newOpt = (POPTION_ITEM)malloc(sizeof(OPTION_ITEM));
|
newOpt = (POPTION_ITEM)malloc(sizeof(OPTION_ITEM));
|
||||||
if (newOpt == NULL) {
|
if (newOpt == NULL) {
|
||||||
freeOptionList(options);
|
|
||||||
exitCode = RTSP_ERROR_NO_MEMORY;
|
exitCode = RTSP_ERROR_NO_MEMORY;
|
||||||
goto ExitFailure;
|
goto ExitFailure;
|
||||||
}
|
}
|
||||||
@@ -221,7 +220,7 @@ int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
|
|||||||
|
|
||||||
ExitFailure:
|
ExitFailure:
|
||||||
if (options) {
|
if (options) {
|
||||||
free(options);
|
freeOptionList(options);
|
||||||
}
|
}
|
||||||
if (messageBuffer) {
|
if (messageBuffer) {
|
||||||
free(messageBuffer);
|
free(messageBuffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user