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:
parent
ecc773c38f
commit
f4c2269d7f
1 changed files with 5 additions and 0 deletions
|
@ -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 !
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue