Sfoglia il codice sorgente

Wayland: Fixed memory leak if output retrieval failed.

Found by Cppcheck.
Philipp Wiesemann 9 anni fa
parent
commit
6fe15d6347
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      src/video/wayland/SDL_waylandvideo.c

+ 1 - 0
src/video/wayland/SDL_waylandvideo.c

@@ -271,6 +271,7 @@ Wayland_add_display(SDL_VideoData *d, uint32_t id)
     output = wl_registry_bind(d->registry, id, &wl_output_interface, 2);
     output = wl_registry_bind(d->registry, id, &wl_output_interface, 2);
     if (!output) {
     if (!output) {
         SDL_SetError("Failed to retrieve output.");
         SDL_SetError("Failed to retrieve output.");
+        SDL_free(display);
         return;
         return;
     }
     }