Fix memory leak in dialog

main
meyraud705 2024-04-05 18:50:44 +02:00 committed by Sam Lantinga
parent 07b7ec68eb
commit db9b4ba2fa
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, NameTransform ntf,
ext_suffix);
if (!converted) {
SDL_free(combined);
return NULL;
}
@ -68,6 +69,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, NameTransform ntf,
SDL_strlcat(combined, converted, new_length);
SDL_strlcat(combined, terminator, new_length);
SDL_free(converted);
}
return combined;