mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Avoid memory leaks if duplicate options are passed.
This commit is contained in:
1 parent
c5ba6016aa
commit
eb92b5f1b3
1 file changed
+1
@@ -4976,6 +4976,7 @@ struct mg_context *mg_start(mg_callback_t user_callback, void *user_data,
|
|||||||
}
|
}
|
||||||
if (ctx->config[i] != NULL) {
|
if (ctx->config[i] != NULL) {
|
||||||
cry(fc(ctx), "warning: %s: duplicate option", name);
|
cry(fc(ctx), "warning: %s: duplicate option", name);
|
||||||
|
free(ctx->config[i]);
|
||||||
}
|
}
|
||||||
ctx->config[i] = mg_strdup(value);
|
ctx->config[i] = mg_strdup(value);
|
||||||
DEBUG_TRACE(("[%s] -> [%s]", name, value));
|
DEBUG_TRACE(("[%s] -> [%s]", name, value));
|
||||||
|
|||||||
Reference in new issue
Block a user