diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-12-12 14:47:38 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-12-12 14:47:38 +0200 |
commit | 4f46a13f08c92b365469fd160415d5f0bf1dbf41 (patch) | |
tree | 51dd128b32535e3ff0f8d06b1560a6aca48a882b | |
parent | 7aeded7e40ca9e02403988c9da8a6fed0b7748c0 (diff) | |
download | tallyman-4f46a13f08c92b365469fd160415d5f0bf1dbf41.tar.gz tallyman-4f46a13f08c92b365469fd160415d5f0bf1dbf41.tar.bz2 |
Fix memory leak
* src/stevedore.c (http_log): Free allocated str.
-rw-r--r-- | src/stevedore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stevedore.c b/src/stevedore.c index fd1eb1c..c39db5c 100644 --- a/src/stevedore.c +++ b/src/stevedore.c @@ -299,12 +299,13 @@ http_log(struct MHD_Connection *connection, if (obj) str = json_to_str(obj); else - str = ""; + str = NULL; info("%s %s - - %s \"%s %s\" \"%s\" %3d \"%s\" \"%s\"", - host, ipstr, tbuf, method, url, str, status, + host, ipstr, tbuf, method, url, str ? str : "", status, referer ? referer : "", user_agent ? user_agent : ""); + free(str); free(ipstr); } |