From f82cf80d4f474f344b453dd6df95b194028a0844 Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Thu, 26 Jul 2007 05:40:27 +0000 Subject: make sure malloc didn't return nil --- common/os_calls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common/os_calls.c') diff --git a/common/os_calls.c b/common/os_calls.c index 8a73c43e..c833e6f5 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -85,7 +85,10 @@ g_malloc(int size, int zero) rv = (char*)malloc(size); if (zero) { - memset(rv, 0, size); + if (rv != 0) + { + memset(rv, 0, size); + } } return rv; } -- cgit v1.2.1