diff options
author | Lim Siew Hoon <siew.hoon.lim@intel.com> | 2016-07-01 13:29:09 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2016-07-22 16:13:20 +0800 |
commit | c0fa72c00aa661faf51d7c1fb1275ef11c5a9667 (patch) | |
tree | 75aab773969bc023cf79cd397ea45627a347c98f /test | |
parent | 5b185d937f354c462ddfe3dd754f7337dc6538c4 (diff) |
Add assert check memory allocation potential NULL issue
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/putsurface/putsurface_wayland.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/putsurface/putsurface_wayland.c b/test/putsurface/putsurface_wayland.c index c3b504f..67da475 100644 --- a/test/putsurface/putsurface_wayland.c +++ b/test/putsurface/putsurface_wayland.c @@ -25,6 +25,7 @@ #include <stddef.h> #include <errno.h> #include <sys/select.h> +#include <assert.h> #ifdef IN_LIBVA # include "va/wayland/va_wayland.h" #else @@ -257,6 +258,7 @@ create_window(void *win_display, int x, int y, int width, int height) wl_shell_surface_set_toplevel(shell_surface); drawable1 = malloc(sizeof(*drawable1)); + assert(drawable1); drawable1->display = display; drawable1->surface = surface1; drawable1->redraw_pending = 0; @@ -272,6 +274,7 @@ create_window(void *win_display, int x, int y, int width, int height) wl_shell_surface_set_toplevel(shell_surface_2); drawable2 = malloc(sizeof(*drawable2)); + assert(drawable2); drawable2->display = display; drawable1->surface = surface2; drawable2->redraw_pending = 0; |