summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-25 07:41:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-25 07:41:23 (GMT)
commit449f2db75dd990d5b1157c7d4da49f046eab27c6 (patch)
tree0c33f05bab8cf9a08b6d08f7c8d4bb0cacbc5e5e /t/helper
parentc8e8b5c3251739c4b515e8bf4cdc2fc85297cb14 (diff)
parent999b951b285233d96904b1aad5e0dea22bed55c7 (diff)
downloadgit-449f2db75dd990d5b1157c7d4da49f046eab27c6.zip
git-449f2db75dd990d5b1157c7d4da49f046eab27c6.tar.gz
git-449f2db75dd990d5b1157c7d4da49f046eab27c6.tar.bz2
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')
-rw-r--r--t/helper/test-prio-queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c
index 5bc9c46..f402844 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);
}