From 63379b4876c10ac84679b10cd60cb6c7235ccd97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Tue, 1 Dec 2015 18:03:49 +0100 Subject: [PATCH] Fix possibly unitialized "ret" --- libhpcs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.43.5