mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-12 21:38:39 +00:00
Don't do NULL-checks before SDL_free()
Replaces the pattern
if (ptr) {
SDL_free(ptr);
}
with
SDL_free(ptr);
This commit is contained in:
committed by
Sam Lantinga
parent
2f810e0a5f
commit
aaee09d6ed
@@ -2642,9 +2642,7 @@ void SetGamepadButtonLabel(GamepadButton *ctx, const char *label)
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->label) {
|
||||
SDL_free(ctx->label);
|
||||
}
|
||||
SDL_free(ctx->label);
|
||||
|
||||
ctx->label = SDL_strdup(label);
|
||||
ctx->label_width = (float)(FONT_CHARACTER_SIZE * SDL_strlen(label));
|
||||
|
||||
Reference in New Issue
Block a user