[Mesa-dev] [PATCH v2 1/3] xmlconfig: read more config files from drirc.d/
Yu, Qiang
Qiang.Yu at amd.com
Fri Aug 3 10:54:57 UTC 2018
Hi Emil,
Thanks for the review, I indeed miss the dirent free.
>> +/** \brief Parse configuration files in a directory */
>> +static void
>> +parseConfigDir(struct OptConfData *data, const char *dirname)
>> +{
>> + int i, count;
>> + struct dirent **entries = NULL;
>> +
>> + count = scandir(dirname, &entries, scandir_filter, alphasort);
>> + if (count < 0)
> We have nothing to do with 0 entries, so make it < 1?
> Or just keep it as-is, if entries still needs to be free'd when 0.
free() is OK for NULL input, so when 0, free is not necessary.
Either way is OK.
Regards,
Qiang
More information about the mesa-dev
mailing list