1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-19 09:42:06 +03:00

Added check for the duplicate option

This commit is contained in:
Sergey Lyubka
2012-03-11 22:14:50 +00:00
parent b78110b92e
commit f085e68baf

View File

@@ -4181,6 +4181,9 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data,
free_context(ctx); free_context(ctx);
return NULL; return NULL;
} }
if (ctx->config[i] != NULL) {
cry(fc(ctx), "%s: duplicate option", name);
}
ctx->config[i] = mg_strdup(value); ctx->config[i] = mg_strdup(value);
DEBUG_TRACE(("[%s] -> [%s]", name, value)); DEBUG_TRACE(("[%s] -> [%s]", name, value));
} }