diff options
author | Uli Schlachter <psychon@znc.in> | 2013-09-11 15:24:53 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2013-09-11 15:24:53 +0200 |
commit | a6f51fed985f7db37c672bab0b5dab3f89e78282 (patch) | |
tree | 51c7ad7b5a1d52132d225d9b6933aeb826f8f629 /src/cairo-recording-surface.c | |
parent | 8addb4798c918000eaa6f6dab138e0abb0efa946 (diff) | |
download | cairo-a6f51fed985f7db37c672bab0b5dab3f89e78282.tar.gz |
recording: Fix unitialized variable 'free_me'
This variable should be NULL by default and gets set only if a new reference to
a surface was acquired through _cairo_surface_snapshot_get_target(). This works,
because cairo_surface_destroy(NULL) is well-defined and doesn't do anything.
Fixes the following compiler warning:
cairo-recording-surface.c:1642:24: warning: 'free_me' may be used uninitialized
in this function [-Wmaybe-uninitialized]
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-recording-surface.c')
-rw-r--r-- | src/cairo-recording-surface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c index eb9af464f..ece904fe6 100644 --- a/src/cairo-recording-surface.c +++ b/src/cairo-recording-surface.c @@ -1617,7 +1617,7 @@ _cairo_recording_surface_merge_source_attributes (cairo_recording_surface_t *su if (source->type == CAIRO_PATTERN_TYPE_SURFACE) { cairo_surface_pattern_t *surf_pat = (cairo_surface_pattern_t *) source; cairo_surface_t *surf = surf_pat->surface; - cairo_surface_t *free_me; + cairo_surface_t *free_me = NULL; if (_cairo_surface_is_snapshot (surf)) free_me = surf = _cairo_surface_snapshot_get_target (surf); |