mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'rs/win32-syslog-leakfix'
Memory leak in an error codepath has been plugged. * rs/win32-syslog-leakfix: win32: plug memory leak on realloc() failure in syslog()
This commit is contained in:
commit
b8feb6ef23
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue