fix: Handle malloc errors properly in pack.c

This commit is contained in:
apio 2023-02-05 14:38:31 +01:00
parent 7339aeeae5
commit bf52d9e321
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -44,6 +44,12 @@ int main(int argc, char** argv)
fseek(fp, 0, SEEK_SET);
char* buf = malloc(length);
if (!buf)
{
perror("malloc");
exit_status = 1;
break;
}
fread(buf, 1, length, fp);
if (ferror(fp))
{