Re: [ethtool PATCH v3 06/12] test-common.c: fix test_realloc(NULL, ...)

2016-03-07 Thread Ben Hutchings
On Fri, 2016-03-04 at 16:42 -0800, David Decotigny wrote:
> From: Maciej Żenczykowski 
> 
> This fixes:
>   test-common.c: In function 'test_realloc':
>   test-common.c:109:8: error: 'block' may be used uninitialized in this 
> function [-Werror=maybe-uninitialized]
> block = realloc(block, sizeof(*block) + size);
>           ^
[...]

LGTM.

Ben.

-- 
Ben Hutchings
The most exhausting thing in life is being insincere. - Anne Morrow Lindberg

signature.asc
Description: This is a digitally signed message part


[ethtool PATCH v3 06/12] test-common.c: fix test_realloc(NULL, ...)

2016-03-04 Thread David Decotigny
From: Maciej Żenczykowski 

This fixes:
  test-common.c: In function 'test_realloc':
  test-common.c:109:8: error: 'block' may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
block = realloc(block, sizeof(*block) + size);
  ^


Signed-off-by: Maciej Żenczykowski 
Signed-off-by: David Decotigny 
---
 test-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test-common.c b/test-common.c
index adc3cd4..cd63d1d 100644
--- a/test-common.c
+++ b/test-common.c
@@ -100,7 +100,7 @@ void test_free(void *ptr)
 
 void *test_realloc(void *ptr, size_t size)
 {
-   struct list_head *block;
+   struct list_head *block = NULL;
 
if (ptr) {
block = (struct list_head *)ptr - 1;
-- 
2.7.0.rc3.207.g0ac5344