concat_path(): Add missing free() calls

This commit is contained in:
Albert S. 2022-10-23 19:54:21 +02:00
parent b5f83499f3
commit 40d23af355
1 changed files with 2 additions and 0 deletions

View File

@ -816,11 +816,13 @@ char *concat_path(const char *first, const char *second)
if(written < 0)
{
EXILE_LOG_ERROR("Error during path concatination\n");
free(result);
return NULL;
}
if(written >= PATH_MAX)
{
EXILE_LOG_ERROR("path concatination truncated\n");
free(result);
return NULL;
}
return result;