screenshooter: check for NULL malloc and fix memleaks

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
clients/desktop-shell: check OOM conditions

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
use xzalloc wrapper instead

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
terminal: use xstrdup instead to handle OOM

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
weston-info: free allocated memory and check OOM conditions

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
clients/window: fail if NULL returned from frame_create

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
exposay: remove redundant NULL check in highlight_surface

exposay_highlight_surface() is called from exposay_pick(),
exposay_layout(), and exposay_maybe_move() where the esurface
parameter is already validated prior to the call.  This makes
the 'esurface' NULL check redundant.  This assumes any future
calls to exposay_highlight_surface() will also validate the
'esurface' parameter prior to the call.

This fixes the logic in exposay_highlight_surface so static
analyzers don't complain about the possibility that 'view'
might be NULL deref'd when a 'esurface' == NULL condition is
true.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
input-panel: validate return value of get_default_view

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
shell: validate get_animation_type parameter

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
shell: validate create_focus_surface results

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
shell: assert get_shell_surface() != NULL as appropriate

Various functions that operate on a weston_surface assume the
surface has a shell_surface.  That is, they unconditionally
deref the get_shell_surface() result.  Hence, if for some reason
the call to get_shell_surface() returned NULL to those functions then
a segmentation fault would occur and the program would crash.  So,
adding an assert(...) on the get_shell_surface() return value adds an
extra sanity check and does not change this behavior.  The assert also
adds an extra benefit to the programmer by documenting that the function
expects and requires the weston_surface to have a shell_surface and
would be a program logic error, otherwise.

The assert() also silences some static analyzers about the possible
NULL deref.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
shared/frame: fix potential memory leak in frame_create

In frame_create, we need to destroy any frame buttons created
in preceding calls to frame_button_create during the function
execution if any of the successive calls to frame_button_create
fail.

This has minimal severity since most, if not all, cases in
frame_button_create that result in a fail (i.e. NULL result) means
a program is OOM and the program will have to exit/abort anyway.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
compositor-wayland: don't free unallocated memory

Assigning a string constant (i.e. memory that we didn't allocate)
to a char* pointer and then freeing that pointer is bad news.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
compositor-wayland: free 'theme' config option value

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
compositor: free memory from str config sections after done using it

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
rpi-backend: ensure pixels is destroyed in resource_update

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
rpi: free renderer if we bail early during create

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>