SDL: Fixed crash if SDL_SYS_CreateThread() fails (thanks @capehill!)

From 7f23f09ee80730225139d9f8b839abb6546d06c4 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 7 Apr 2026 12:22:33 -0700
Subject: [PATCH] Fixed crash if SDL_SYS_CreateThread() fails (thanks
 @capehill!)

Fixes https://github.com/libsdl-org/SDL/issues/15340
---
 src/thread/SDL_thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c
index 9ffba9592c531..efa1b72d4eb05 100644
--- a/src/thread/SDL_thread.c
+++ b/src/thread/SDL_thread.c
@@ -411,7 +411,7 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props,
         SDL_DestroySemaphore(thread->ready_sem);
         SDL_free(thread->name);
         SDL_free(thread);
-        thread = NULL;
+		return NULL;
     }
 
     SDL_WaitSemaphore(thread->ready_sem);