Closed M-Bab closed 2 months ago
Hi M-Bab,
Thanks for bringing this to my attention. I think I actually have this as an uncommitted change that fell through the cracks. Since name
should be immutable, the correct way to handle this is free((char *) name);
or free((void *) name);
. I'd go with the later, because that matches the prototype of the free function. Feel free to make a PR.
Thanks a lot, sorry I missed to make a PR for this.
At first thanks for your great project! Nice to see all its progress and continuously better integration as ESP component.
Quite simple issue here: We get a compile warning which can be easily avoided in https://github.com/jkent/frogfs/blob/bf6173f75974acb83f86118864d27064e72d39e1/src/vfs.c#L216
The target of name is dynamically allocated so not so constant after all. free(name) causes a warning because free wants (obviously) a non-constant input.
Several easy solutions:
const char *name = frogfs_get_name(entry);
-->char *name = frogfs_get_name(entry);
free(name)
-->free((char*) name)
free(name)
-->free((void*) name)
I can create a PR for this if it helps but I am not sure which is your favorite solution.