From 9d3a2394e4d3f91f1e23a971ce34aaf031a1e777 Mon Sep 17 00:00:00 2001 From: Vlad Golovkin Date: Wed, 1 Aug 2018 20:56:23 +0300 Subject: [PATCH] swr: Remove unnecessary memset call Zeroing memory after calloc is not necessary. This also allows to avoid possible crash when allocation fails, because memset is called before checking screen for NULL. Fixes: a29d63ecf71546c4798c6 "swr: refactor swr_create_screen to allow for proper cleanup on error" Reviewed-by: Eric Engestrom --- src/gallium/drivers/swr/swr_screen.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp index fa232b6838b..67085444f84 100644 --- a/src/gallium/drivers/swr/swr_screen.cpp +++ b/src/gallium/drivers/swr/swr_screen.cpp @@ -1148,7 +1148,6 @@ struct pipe_screen * swr_create_screen_internal(struct sw_winsys *winsys) { struct swr_screen *screen = CALLOC_STRUCT(swr_screen); - memset(screen, 0, sizeof(struct swr_screen)); if (!screen) return NULL; -- 2.30.2