[commits] [alfred] master: alfred: Test for failed global memory allocation (09c40ac)

postmaster at open-mesh.org postmaster at open-mesh.org
Wed Oct 17 22:16:04 CEST 2012


Repository : ssh://git@open-mesh.org/alfred

On branch  : master

>---------------------------------------------------------------

commit 09c40ac1d0f1d656e0a767685ecebd0fffaf5796
Author: Sven Eckelmann <sven at narfation.org>
Date:   Wed Oct 17 21:49:23 2012 +0200

    alfred: Test for failed global memory allocation
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


>---------------------------------------------------------------

09c40ac1d0f1d656e0a767685ecebd0fffaf5796
 main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c
index 0315fe3..0852236 100644
--- a/main.c
+++ b/main.c
@@ -67,11 +67,11 @@ struct globals *alfred_init(int argc, char *argv[])
 	};
 
 	globals = malloc(sizeof(*globals));
-	memset(globals, 0, sizeof(*globals));
-
 	if (!globals)
 		return NULL;
 
+	memset(globals, 0, sizeof(*globals));
+
 	globals->opmode = OPMODE_SLAVE;
 	globals->clientmode = CLIENT_NONE;
 	globals->interface = NULL;



More information about the commits mailing list