Christoph Mallon: Remove pointless if (x) before SDL_free(x)

This commit is contained in:
Sam Lantinga 2013-08-29 08:29:21 -07:00
parent edc88be724
commit 08dfaaa2e6
63 changed files with 157 additions and 349 deletions

View file

@ -72,9 +72,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
entry->callback(entry->userdata, name, hint->value, value);
entry = next;
}
if (hint->value) {
SDL_free(hint->value);
}
SDL_free(hint->value);
hint->value = value ? SDL_strdup(value) : NULL;
}
hint->priority = priority;
@ -206,9 +204,7 @@ void SDL_ClearHints(void)
SDL_hints = hint->next;
SDL_free(hint->name);
if (hint->value) {
SDL_free(hint->value);
}
SDL_free(hint->value);
for (entry = hint->callbacks; entry; ) {
SDL_HintWatch *freeable = entry;
entry = entry->next;