diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-23 18:17:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-23 18:17:59 +0100 |
commit | 1fe4fe45afa7d6749e1dbb1e95d2371120830a4c (patch) | |
tree | 59f8cf6a1f48d1d5295a79faf8d76219b4a61178 /src/fuzzy_storage.c | |
parent | f3b08af57c535bf632b600ef7b4d53eae3306744 (diff) | |
download | rspamd-1fe4fe45afa7d6749e1dbb1e95d2371120830a4c.tar.gz rspamd-1fe4fe45afa7d6749e1dbb1e95d2371120830a4c.zip |
[Fix] Free the correct pointer
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r-- | src/fuzzy_storage.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 6c7289fee..cbea7d7f1 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -890,7 +890,7 @@ rspamd_fuzzy_mirror_process_update (struct fuzzy_master_update_session *session, struct rspamd_http_message *msg) { const guchar *p; - gchar *src = NULL; + gchar *src = NULL, *psrc; gsize remain; guint32 revision, our_rev, len, cnt = 0; struct fuzzy_peer_cmd cmd, *pcmd; @@ -909,7 +909,8 @@ rspamd_fuzzy_mirror_process_update (struct fuzzy_master_update_session *session, /* Detect source from url: /update_v1/<source>, so we look for the last '/' */ remain = msg->url->len; - src = rspamd_fstringdup (msg->url); + psrc = rspamd_fstringdup (msg->url); + src = psrc; while (remain--) { if (src[remain] == '/') { @@ -938,7 +939,7 @@ rspamd_fuzzy_mirror_process_update (struct fuzzy_master_update_session *session, if (revision <= our_rev) { msg_err ("remote revision:d %d is older than ours: %d, refusing update", revision, our_rev); - g_free (src); + g_free (psrc); return; } @@ -1027,7 +1028,7 @@ rspamd_fuzzy_mirror_process_update (struct fuzzy_master_update_session *session, " revision: %ud", cnt, revision); err: - g_free (src); + g_free (psrc); if (updates) { /* We still need to clear queue */ |