diff --git a/rc.c b/rc.c index 834f8f4..9f041ed 100644 --- a/rc.c +++ b/rc.c @@ -5755,7 +5755,10 @@ SDL_Surface *grabbehind(sprite_t *s, SDL_Surface *surf) { SDL_Rect area; // create buffer for player background - if (surf) SDL_FreeSurface(surf); + if (surf) { + SDL_FreeSurface(surf); + surf = NULL; + } surf = SDL_CreateRGBSurface(SDL_SWSURFACE, s->img->w, s->img->h, screen->format->BitsPerPixel, screen->format->Rmask, @@ -8559,6 +8562,7 @@ void keeponscreen(sprite_t *s) { void stopteleporting(sprite_t *s) { if (s->allocimg) { SDL_FreeSurface(s->img); + s->img = NULL; } s->allocimg = B_FALSE; s->teleporting = 0;