Fix use after free

This commit is contained in:
Joris Vink 2014-04-09 14:35:14 +02:00
parent 630d8ece05
commit 250a1e1ad1
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}