mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Fix freeing uninitialized pointer on allocation failure
This commit is contained in:
parent
c8faf3539b
commit
b44cad6598
@ -126,8 +126,8 @@ static int reconstructFrame(PRTP_FEC_QUEUE queue) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reed_solomon* rs = NULL;
|
reed_solomon* rs = NULL;
|
||||||
unsigned char** packets = malloc(totalPackets * sizeof(unsigned char*));
|
unsigned char** packets = calloc(totalPackets, sizeof(unsigned char*));
|
||||||
unsigned char* marks = malloc(totalPackets * sizeof(unsigned char));
|
unsigned char* marks = calloc(totalPackets, sizeof(unsigned char));
|
||||||
if (packets == NULL || marks == NULL) {
|
if (packets == NULL || marks == NULL) {
|
||||||
ret = -2;
|
ret = -2;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user