summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/grdev.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-09-23 13:40:18 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-23 20:05:45 +0200
commitc5e6bfc6bc46dd8bc187e035929d6a49cd23ec09 (patch)
tree9233426b156db10e6c9abb6a00129fa366a4a4b2 /src/libsystemd-terminal/grdev.c
parentb4170aed36e667e52ce4a353bda1964e3872ab34 (diff)
terminal: verify grdev tiles are correctly linked
We used to set "pipe->tile = tile" inside of the leaf allocation. We no longer do that. Verify that "out" is non-NULL, otherwise we'd leak memory. This is currently always given, but make sure to add an assert(), so coverity does not complain.
Diffstat (limited to 'src/libsystemd-terminal/grdev.c')
-rw-r--r--src/libsystemd-terminal/grdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c
index 80a71beeb9..fa1fc378c8 100644
--- a/src/libsystemd-terminal/grdev.c
+++ b/src/libsystemd-terminal/grdev.c
@@ -158,6 +158,7 @@ int grdev_tile_new_leaf(grdev_tile **out, grdev_pipe *pipe) {
_cleanup_(grdev_tile_freep) grdev_tile *tile = NULL;
int r;
+ assert_return(out, -EINVAL);
assert_return(pipe, -EINVAL);
assert_return(!pipe->tile, -EINVAL);