Quellcode durchsuchen

Fixed memory leak when out of memory

Sam Lantinga vor 4 Jahren
Ursprung
Commit
bac8df4abd
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      src/joystick/linux/SDL_sysjoystick.c

+ 1 - 0
src/joystick/linux/SDL_sysjoystick.c

@@ -331,6 +331,7 @@ MaybeAddDevice(const char *path)
 
     item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item));
     if (item == NULL) {
+        SDL_free(name);
         return -1;
     }