From f085e68bafc9a5e463bb44216b0423d6e67a477c Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Sun, 11 Mar 2012 22:14:50 +0000 Subject: [PATCH] Added check for the duplicate option --- mongoose.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mongoose.c b/mongoose.c index b92671f8..864e76ad 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4181,6 +4181,9 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data, free_context(ctx); return NULL; } + if (ctx->config[i] != NULL) { + cry(fc(ctx), "%s: duplicate option", name); + } ctx->config[i] = mg_strdup(value); DEBUG_TRACE(("[%s] -> [%s]", name, value)); }