diff --git a/common/branch-mgr.c b/common/branch-mgr.c index fc46f57..2758754 100644 --- a/common/branch-mgr.c +++ b/common/branch-mgr.c @@ -314,16 +314,13 @@ get_commit_id (SeafDBRow *row, void *data) } static void -publish_repo_update_event (char *repo_id, char *commit_id) +publish_repo_update_event (const char *repo_id, const char *commit_id) { char buf[128]; snprintf (buf, sizeof(buf), "repo-update\t%s\t%s", repo_id, commit_id); publish_event (seaf->mq_mgr, SEAFILE_SERVER_CHANNEL_EVENT, buf); - - g_free (repo_id); - g_free (commit_id); } static void diff --git a/server/http-server.c b/server/http-server.c index edfd62b..36d66b0 100644 --- a/server/http-server.c +++ b/server/http-server.c @@ -534,7 +534,6 @@ publish_repo_event (RepoEventData *rdata) publish_event (seaf->mq_mgr, SEAFILE_SERVER_CHANNEL_EVENT, buf->str); g_string_free (buf, TRUE); - free_repo_event_data (rdata); } static void @@ -548,7 +547,6 @@ publish_stats_event (StatsEventData *rdata) publish_event (seaf->mq_mgr, SEAFILE_SERVER_CHANNEL_STATS, buf->str); g_string_free (buf, TRUE); - free_stats_event_data (rdata); } static void @@ -574,6 +572,7 @@ on_repo_oper (HttpServer *htp_server, const char *etype, g_free (vinfo->path); g_free (vinfo); } + free_repo_event_data (rdata); return; } @@ -588,6 +587,8 @@ send_statistic_msg (const char *repo_id, char *user, char *operation, guint64 by rdata->bytes = bytes; publish_stats_event(rdata); + + free_stats_event_data (rdata); return; }