mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
extra check in mg_start(): options may be NULL
This commit is contained in:
1 parent
1d490f9d6c
commit
3e5d2bd3ac
1 file changed
+1
-1
+1
-1
@@ -3999,7 +3999,7 @@ struct mg_context *mg_start(mg_callback_t user_callback, const char **options) {
|
|||||||
ctx = calloc(1, sizeof(*ctx));
|
ctx = calloc(1, sizeof(*ctx));
|
||||||
ctx->user_callback = user_callback;
|
ctx->user_callback = user_callback;
|
||||||
|
|
||||||
while ((name = *options++) != NULL) {
|
while (options && (name = *options++) != NULL) {
|
||||||
if ((i = get_option_index(name)) == -1) {
|
if ((i = get_option_index(name)) == -1) {
|
||||||
cry(fc(ctx), "Invalid option: %s", name);
|
cry(fc(ctx), "Invalid option: %s", name);
|
||||||
free_context(ctx);
|
free_context(ctx);
|
||||||
|
|||||||
Reference in new issue
Block a user