mirror of https://git.kore.io/kore.git
Fix use after free
This commit is contained in:
parent
630d8ece05
commit
250a1e1ad1
|
@ -127,9 +127,8 @@ kore_accesslog_wait(void)
|
|||
}
|
||||
|
||||
len = write(dom->accesslog, buf, l);
|
||||
free(buf);
|
||||
|
||||
if (len == -1) {
|
||||
free(buf);
|
||||
kore_log(LOG_WARNING,
|
||||
"kore_accesslog_wait(): write(): %s", errno_s);
|
||||
return (KORE_RESULT_ERROR);
|
||||
|
@ -138,6 +137,7 @@ kore_accesslog_wait(void)
|
|||
if (len != l)
|
||||
kore_log(LOG_NOTICE, "accesslog: %s", buf);
|
||||
|
||||
free(buf);
|
||||
return (KORE_RESULT_OK);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue