1
0
Fork 0
mirror of https://github.com/ErikAndren/cue2pops-mac.git synced 2025-04-19 15:38:04 +02:00

Check if the bin_path malloc failed

This commit is contained in:
Erik Andrén Zachrisson 2015-11-01 12:55:01 +01:00
parent ecc773c38f
commit f4c2269d7f

View file

@ -504,6 +504,11 @@ int main(int argc, char **argv)
bin_path = malloc((strlen(ptr) + strlen(argv[1])) * 2);
if (bin_path == NULL) {
printf("Error: Failed to allocate memory for the bin_path string\n");
free(cuebuf);
return 0;
}
for(i = strlen(ptr); i > 0; i--) { // Does the cue have the full BINARY path ?
if((ptr[i] == '\\') || (ptr[i] == '/')) { // YES !