diff --git a/core/emperor.c b/core/emperor.c index d61890d2..393685e6 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -432,6 +432,10 @@ void emperor_add(char *name, time_t born, char *config, uint32_t config_size, ui int i; struct timeval tv; +#ifdef UWSGI_DEBUG + uwsgi_log("\n\nVASSAL %s %d %.*s %d %d\n", name, born, config_size, config, uid, gid); +#endif + if (strlen(name) > (0xff - 1)) { uwsgi_log("[emperor] invalid vassal name\n", name); return; diff --git a/plugins/emperor_pg/emperor_pg.c b/plugins/emperor_pg/emperor_pg.c index 09a65396..9a53e73c 100644 --- a/plugins/emperor_pg/emperor_pg.c +++ b/plugins/emperor_pg/emperor_pg.c @@ -38,7 +38,8 @@ void emperor_pg_do(char *name, char *config, time_t ts, uid_t uid, gid_t gid) { } } else { - emperor_add(name, ts, config, strlen(config), uid, gid); + // make a copy of the config as it will be freed + emperor_add(name, ts, uwsgi_str(config), strlen(config), uid, gid); } }