From ea9f95b19f8813c409f04ac2bf205fd15f100065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D1=80?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Thu, 21 May 2015 07:38:32 +0400 Subject: [PATCH] Releasing attrs memory when it's needed --- core/emperor.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/emperor.c b/core/emperor.c index 13655800..9a58d491 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -2684,12 +2684,19 @@ next: } void uwsgi_emperor_simple_do_with_attrs(struct uwsgi_emperor_scanner *ues, char *name, char *config, time_t ts, uid_t uid, gid_t gid, char *socket_name, struct uwsgi_dyn_dict *attrs) { - if (!uwsgi_emperor_is_valid(name)) + if (!uwsgi_emperor_is_valid(name)) { + if (attrs) + uwsgi_dyn_dict_free(&attrs); return; + } struct uwsgi_instance *ui_current = emperor_get(name); if (ui_current) { + if (ui_current->attrs) { + uwsgi_dyn_dict_free(&ui_current->attrs); + } + ui_current->attrs = attrs; // skip in case the instance is going down... if (ui_current->status > 0)