Skip to content

Commit

Permalink
Refine #1739
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Oct 18, 2017
1 parent b3f3b58 commit f19a96e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jconf.c
Expand Up @@ -295,6 +295,8 @@ read_jconf(const char *file)
} else if (strcmp(name, "mode") == 0) {
char *mode_str = to_string(value);

if (mode_str == NULL)
conf.mode = TCP_ONLY;
if (strcmp(mode_str, "tcp_only") == 0)
conf.mode = TCP_ONLY;
else if (strcmp(mode_str, "tcp_and_udp") == 0)
Expand All @@ -304,6 +306,7 @@ read_jconf(const char *file)
else
LOGI("ignore unknown mode: %s, use tcp_only as fallback",
mode_str);

ss_free(mode_str);
} else if (strcmp(name, "mtu") == 0) {
check_json_value_type(value, json_integer,
Expand Down

0 comments on commit f19a96e

Please sign in to comment.