From fa1382604373ba44c7c4fb8ad4c8fcbd753dbe78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Bohner=20=28xzvf=29?= Date: Fri, 8 Jul 2022 09:05:00 +0200 Subject: [PATCH] Revert "Coalesce cleanup in ffParsePropFileValues" This reverts commit 7bc85b239746b64c94eebad8e3917da328d71702. --- src/common/properties.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/common/properties.c b/src/common/properties.c index df9a7b60c..de39be817 100644 --- a/src/common/properties.c +++ b/src/common/properties.c @@ -92,8 +92,6 @@ bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer) bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquery* queries) { - bool returnValue = true; - bool valueStorage[4]; bool* unsetValues; @@ -110,10 +108,19 @@ bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquer } FILE* file = fopen(filename, "r"); - if(file == NULL || allSet) + if(file == NULL) { - returnValue = allSet; - goto cleanup; + if(unsetValues != valueStorage) + free(unsetValues); + return false; + } + + if(allSet) + { + fclose(file); + if(unsetValues != valueStorage) + free(unsetValues); + return true; } char* line = NULL; @@ -136,13 +143,12 @@ bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquer if(line != NULL) free(line); -cleanup: - if(file != NULL) - fclose(file); + fclose(file); + if(unsetValues != valueStorage) free(unsetValues); - return returnValue; + return true; } bool ffParsePropFile(const char* filename, const char* start, FFstrbuf* buffer)