Clang static analyser warnings

This commit is contained in:
Shahram Najm 2020-03-20 12:43:03 +00:00
parent b8cb4e0394
commit cfaa03f226
1 changed files with 6 additions and 1 deletions

View File

@ -444,7 +444,12 @@ char* grib_options_get_args(char* id)
}
for (i = 0; i < grib_options_help_count; i++) {
if (!strcmp(id, grib_options_help_list[i].id)) {
return grib_options_help_list[i].args != NULL ? (char*)grib_options_help_list[i].args : err;
if (grib_options_help_list[i].args != NULL) {
free(err);
return (char*)grib_options_help_list[i].args;
} else {
return err;
}
}
}
return err;