Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/xmalloc'
author
Junio C Hamano
<gitster@pobox.com>
Thu, 25 Apr 2019 07:41:23 +0000
(16:41 +0900)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 25 Apr 2019 07:41:23 +0000
(16:41 +0900)
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
1
2
progress.c
patch
|
diff1
|
diff2
|
blob
|
history
raw
|
combined
(merge:
c8e8b5c
999b951
)
diff --cc
progress.c
index 6cde5959fac75ab2640f11346dd124c962d98067,699ac33c4f0609351a403e6779952c6c6ab7cb74..0318bdd41b2f40b6f3cedeb8ca72ead677038d6e
---
1
/
progress.c
---
2
/
progress.c
+++ b/
progress.c
@@@
-223,15
-192,9
+221,9
@@@
void display_progress(struct progress *
}
static struct progress *start_progress_delay(const char *title, uint64_t total,
- unsigned delay)
+ unsigned delay
, unsigned sparse
)
{
- struct progress *progress = malloc(sizeof(*progress));
- if (!progress) {
- /* unlikely, but here's a good fallback */
- fprintf(stderr, "%s...\n", title);
- fflush(stderr);
- return NULL;
- }
+ struct progress *progress = xmalloc(sizeof(*progress));
progress->title = title;
progress->total = total;
progress->last_value = -1;