Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'rs/win32-syslog-leakfix'
author
Junio C Hamano
<gitster@pobox.com>
Tue, 22 Aug 2017 17:29:16 +0000
(10:29 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 22 Aug 2017 17:29:16 +0000
(10:29 -0700)
Memory leak in an error codepath has been plugged.
* rs/win32-syslog-leakfix:
win32: plug memory leak on realloc() failure in syslog()
compat/win32/syslog.c
patch
|
blob
|
history
raw
(from parent 1:
030e293
)
diff --git
a/compat/win32/syslog.c
b/compat/win32/syslog.c
index 6c7c9b60538d932d6dbc2d32774a6f64f8687c69..161978d720aed9db5a00c77d1c6bd9a073544f15 100644
(file)
--- a/
compat/win32/syslog.c
+++ b/
compat/win32/syslog.c
@@
-43,8
+43,10
@@
void syslog(int priority, const char *fmt, ...)
va_end(ap);
while ((pos = strstr(str, "%1")) != NULL) {
+ char *oldstr = str;
str = realloc(str, st_add(++str_len, 1));
if (!str) {
+ free(oldstr);
warning_errno("realloc failed");
return;
}