diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:23 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:23 +0900 |
commit | 449f2db75dd990d5b1157c7d4da49f046eab27c6 (patch) | |
tree | 0c33f05bab8cf9a08b6d08f7c8d4bb0cacbc5e5e /t/helper/test-prio-queue.c | |
parent | Merge branch 'km/t3000-retitle' (diff) | |
parent | progress: use xmalloc/xcalloc (diff) | |
download | tgif-449f2db75dd990d5b1157c7d4da49f046eab27c6.tar.xz |
Merge branch 'jk/xmalloc'
The code is updated to check the result of memory allocation before
it is used in more places, by using xmalloc and/or xcalloc calls.
* jk/xmalloc:
progress: use xmalloc/xcalloc
xdiff: use xmalloc/xrealloc
xdiff: use git-compat-util
test-prio-queue: use xmalloc
Diffstat (limited to 't/helper/test-prio-queue.c')
-rw-r--r-- | t/helper/test-prio-queue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c index 5bc9c46ea5..f4028442e3 100644 --- a/t/helper/test-prio-queue.c +++ b/t/helper/test-prio-queue.c @@ -40,7 +40,7 @@ int cmd__prio_queue(int argc, const char **argv) } else if (!strcmp(*argv, "stack")) { pq.compare = NULL; } else { - int *v = malloc(sizeof(*v)); + int *v = xmalloc(sizeof(*v)); *v = atoi(*argv); prio_queue_put(&pq, v); } |