mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-28 08:44:21 +00:00
Fix freeing uninitialized pointer on allocation failure
This commit is contained in:
1 parent
c8faf3539b
commit
b44cad6598
1 file changed
+2
-2
+2
-2
@@ -126,8 +126,8 @@ static int reconstructFrame(PRTP_FEC_QUEUE queue) {
|
||||
}
|
||||
|
||||
reed_solomon* rs = NULL;
|
||||
unsigned char** packets = malloc(totalPackets * sizeof(unsigned char*));
|
||||
unsigned char* marks = malloc(totalPackets * sizeof(unsigned char));
|
||||
unsigned char** packets = calloc(totalPackets, sizeof(unsigned char*));
|
||||
unsigned char* marks = calloc(totalPackets, sizeof(unsigned char));
|
||||
if (packets == NULL || marks == NULL) {
|
||||
ret = -2;
|
||||
goto cleanup;
|
||||
|
||||
Reference in new issue
Block a user