mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-07-01 23:35:58 +00:00
Fix leak in unreachable codepath
This commit is contained in:
parent
c3e9aea843
commit
a258b7e12b
@ -543,6 +543,7 @@ char* getSdpPayloadForStreamConfig(int rtspClientVersion, int* length) {
|
||||
written = fillSdpHeader(payload, MAX_SDP_HEADER_LEN, rtspClientVersion, urlSafeAddr);
|
||||
if (written < 0 || written >= MAX_SDP_HEADER_LEN) {
|
||||
LC_ASSERT(false);
|
||||
free(payload);
|
||||
freeAttributeList(attributeList);
|
||||
return NULL;
|
||||
}
|
||||
@ -552,6 +553,7 @@ char* getSdpPayloadForStreamConfig(int rtspClientVersion, int* length) {
|
||||
written = fillSerializedAttributeList(&payload[offset], attributeListSize, attributeList);
|
||||
if (written < 0 || written >= attributeListSize) {
|
||||
LC_ASSERT(false);
|
||||
free(payload);
|
||||
freeAttributeList(attributeList);
|
||||
return NULL;
|
||||
}
|
||||
@ -561,6 +563,7 @@ char* getSdpPayloadForStreamConfig(int rtspClientVersion, int* length) {
|
||||
written = fillSdpTail(&payload[offset], MAX_SDP_TAIL_LEN);
|
||||
if (written < 0 || written >= MAX_SDP_TAIL_LEN) {
|
||||
LC_ASSERT(false);
|
||||
free(payload);
|
||||
freeAttributeList(attributeList);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user