[Spice-devel] [spice-common 1/8] coverity: avoid use after free

Fabiano FidĂȘncio fidencio at redhat.com
Mon Apr 4 08:03:32 UTC 2016


---
 common/canvas_utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index c5813f4..0be761a 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -109,6 +109,7 @@ static inline pixman_image_t *__surface_create_stride(pixman_format_code_t forma
 
     if (surface == NULL) {
         free(data);
+        data = NULL;
         spice_error("create surface failed, out of memory");
     }
 
-- 
2.7.3



More information about the Spice-devel mailing list