From 6a72f9bcd5aa5ef11500357077eb00a3c271bb61 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 22 Feb 2009 18:58:25 +0100 Subject: [PATCH] Fix memory allocation check in open_commit_parent_menu The check was not converted when the code was moved to a separate function before the commit. To test the menu using the tig repository start tig using: tig blame cf63d30cbc4efb2bb87e52c4e54366751bb958fa Makefile Then go to line 80 (type ":80") and press the key for moving to the parent (bound to ',' by default). --- tig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tig.c b/tig.c index 60d73d5..58d7bd0 100644 --- a/tig.c +++ b/tig.c @@ -3530,7 +3530,7 @@ open_commit_parent_menu(char buf[SIZEOF_STR], int *parents) int i; items = calloc(*parents + 1, sizeof(*items)); - if (items) + if (!items) return FALSE; for (i = 0; i < *parents; i++) { -- 2.11.4.GIT