If the extra_extensions string is empty there's no need to call
atexit() - there's nothing to free.
v2: Rebase
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
int len;
size_t offset;
- atexit(free_unknown_extensions_strings);
-
memset(&_mesa_extension_override_enables, 0, sizeof(struct gl_extensions));
memset(&_mesa_extension_override_disables, 0, sizeof(struct gl_extensions));
len = strlen(extra_extensions);
if (len == 0) {
free(extra_extensions);
- extra_extensions = NULL;
} else if (extra_extensions[len - 1] == ' ') {
extra_extensions[len - 1] = '\0';
+ atexit(free_unknown_extensions_strings);
}
}