Previously we could try to iterate over `files`
even if it were NULL.
Fixes bug #41043; bugfix on 0.4.9.2-alpha.
--- /dev/null
+ o Minor bugfixes (relay):
+ - Fix a crash when FamilyKeyDir is a path that cannot be read.
+ Fixes bug 41043; bugfix on 0.4.9.2-alpha.
SMARTLIST_FOREACH(result, char *, cp, tor_free(cp));
smartlist_free(result); // sets result to NULL.
done:
- SMARTLIST_FOREACH(files, char *, cp, tor_free(cp));
- smartlist_free(files);
+ if (files) {
+ SMARTLIST_FOREACH(files, char *, cp, tor_free(cp));
+ smartlist_free(files);
+ }
return result;
}