From eb92b5f1b3f1c513fb70cef15d5be6f8d82d2f3d Mon Sep 17 00:00:00 2001 From: "nullable.type" Date: Fri, 2 Nov 2012 22:52:47 +0100 Subject: [PATCH] Avoid memory leaks if duplicate options are passed. --- mongoose.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mongoose.c b/mongoose.c index 9ed3c638..acfb3787 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4976,6 +4976,7 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data, } if (ctx->config[i] != NULL) { cry(fc(ctx), "warning: %s: duplicate option", name); + free(ctx->config[i]); } ctx->config[i] = mg_strdup(value); DEBUG_TRACE(("[%s] -> [%s]", name, value));