I was used to using the dynamic string in my project, so when calling functions like mz_zip_reader_set_pattern, I couldn't free the string after calling such functions, which must cause a segfault. Keeping the lifetime of such string in function's lifetime might be hard since one can forget to free such string.
Since freeing a NULL pointer is safe, it is possible to make strings in structure dynamically assigned and then freed at last.