|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From c5e6bfc6bc46dd8bc187e035929d6a49cd23ec09 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Tue, 23 Sep 2014 13:40:18 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: verify grdev tiles are correctly linked
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
We used to set "pipe->tile = tile" inside of the leaf allocation. We no
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
longer do that. Verify that "out" is non-NULL, otherwise we'd leak memory.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
This is currently always given, but make sure to add an assert(), so
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
coverity does not complain.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/grdev.c | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 1 insertion(+)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 80a71beeb9..fa1fc378c8 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/grdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/grdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -158,6 +158,7 @@ int grdev_tile_new_leaf(grdev_tile **out, grdev_pipe *pipe) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_(grdev_tile_freep) grdev_tile *tile = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert_return(out, -EINVAL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_return(pipe, -EINVAL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_return(!pipe->tile, -EINVAL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|