From 46bfaeae9e7ad2217a99ac8e9feaab4e116c962d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 12 Mar 2011 20:40:30 +0100 Subject: [PATCH] gdi32: Avoid null pointer access when we are out of gdi handles. --- dlls/gdi32/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index bdaab13b378..6cfe4825c11 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -151,7 +151,7 @@ DC *alloc_dc_ptr( const DC_FUNCTIONS *funcs, WORD magic ) if (!(dc->hSelf = alloc_gdi_handle( &dc->header, magic, &dc_funcs ))) { HeapFree( GetProcessHeap(), 0, dc ); - dc = NULL; + return NULL; } dc->nulldrv.hdc = dc->hSelf; return dc;