Commit c8416cc1 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

NULL out name server field properly

Fixes https://github.com/cesanta/mongoose-os/issues/260

PUBLISHED_FROM=e95076915d52edb2298e3ea386281c277e42c89a
parent cf0a969a
...@@ -11129,6 +11129,7 @@ int mg_resolve_async_opt(struct mg_mgr *mgr, const char *name, int query, ...@@ -11129,6 +11129,7 @@ int mg_resolve_async_opt(struct mg_mgr *mgr, const char *name, int query,
void mg_set_nameserver(struct mg_mgr *mgr, const char *nameserver) { void mg_set_nameserver(struct mg_mgr *mgr, const char *nameserver) {
MG_FREE((char *) mgr->nameserver); MG_FREE((char *) mgr->nameserver);
mgr->nameserver = NULL;
if (nameserver != NULL) { if (nameserver != NULL) {
mgr->nameserver = strdup(nameserver); mgr->nameserver = strdup(nameserver);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment