chiark / gitweb /
terminal: verify grdev tiles are correctly linked
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 23 Sep 2014 11:40:18 +0000 (13:40 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 23 Sep 2014 18:05:45 +0000 (20:05 +0200)
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.

src/libsystemd-terminal/grdev.c

index 80a71beeb937693bf81abcffdcced031634409b5..fa1fc378c807337e03650f8a7b8e7108acb9f288 100644 (file)
@@ -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;
 
         _cleanup_(grdev_tile_freep) grdev_tile *tile = NULL;
         int r;
 
+        assert_return(out, -EINVAL);
         assert_return(pipe, -EINVAL);
         assert_return(!pipe->tile, -EINVAL);
 
         assert_return(pipe, -EINVAL);
         assert_return(!pipe->tile, -EINVAL);