From: Michal MalĂ˝ Date: Tue, 1 Dec 2015 17:03:49 +0000 (+0100) Subject: Fix possibly unitialized "ret" X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=63379b4876c10ac84679b10cd60cb6c7235ccd97;p=libHPCS.git Fix possibly unitialized "ret" --- diff --git a/libhpcs.c b/libhpcs.c index f17eda5..9df05b6 100644 --- a/libhpcs.c +++ b/libhpcs.c @@ -135,8 +135,10 @@ enum HPCS_RetCode hpcs_read_mdata(const char* filename, struct HPCS_MeasuredData } pret = read_file_type_description(datafile, &mdata->file_description); - if (pret != PARSE_OK) + if (pret != PARSE_OK) { + ret = HPCS_E_PARSE_ERROR; goto out; + } if (!file_type_description_is_readable(mdata->file_description)) { PR_DEBUGF("Incompatible file description: %s\n", mdata->file_description); @@ -217,8 +219,10 @@ enum HPCS_RetCode hpcs_read_mheader(const char* filename, struct HPCS_MeasuredDa } pret = read_file_type_description(datafile, &mdata->file_description); - if (pret != PARSE_OK) + if (pret != PARSE_OK) { + ret = HPCS_E_PARSE_ERROR; goto out; + } if (!file_type_description_is_readable(mdata->file_description)) { PR_DEBUGF("Incompatible file description: %s\n", mdata->file_description);