Functions like int vmaf_model_feature_overload(VmafModel *model, const char *feature_name, VmafFeatureDictionary *opts_dict) sometimes free the passed in dictionary and sometimes doesn't. It doesn't seem to signal if the dictionary has been cleaned up or not to the caller other than by statically analyzing different error paths within the function.
This seems to be asking for memory-leaks, double-frees, and use-after-frees.
IMO it would make more sense for functions that might free dictionaries to accept a VmafDictionary** and null the inner pointer on free that same way vmaf_dictionary_free works.
Functions like
int vmaf_model_feature_overload(VmafModel *model, const char *feature_name, VmafFeatureDictionary *opts_dict)sometimes free the passed in dictionary and sometimes doesn't. It doesn't seem to signal if the dictionary has been cleaned up or not to the caller other than by statically analyzing different error paths within the function.This seems to be asking for memory-leaks, double-frees, and use-after-frees.
IMO it would make more sense for functions that might free dictionaries to accept a
VmafDictionary**and null the inner pointer on free that same wayvmaf_dictionary_freeworks.