memutil and free_is_not_null aren't needed, so delete and replace them by free()