From: Jonas Fonseca Date: Sun, 22 Feb 2009 17:58:25 +0000 (+0100) Subject: Fix memory allocation check in open_commit_parent_menu X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6a72f9bcd5aa5ef11500357077eb00a3c271bb61;p=tig.git 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). --- 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++) {