Skip to content

Commit

Permalink
fixes nanomsg#841 Calling nng_stats_get() before creating socket panics
Browse files Browse the repository at this point in the history
While here fixed a spelling error in the description of the global
statistics structure.
  • Loading branch information
gdamore committed Jan 1, 2019
1 parent fa65c83 commit 573cdf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ int
nng_stats_get(nng_stat **statp)
{
#ifdef NNG_ENABLE_STATS
int rv;
if ((rv = nni_init()) != 0) {
return (rv);
}
return (nni_stat_snapshot(statp, &stats_root));
#else
NNI_ARG_UNUSED(statp);
Expand Down Expand Up @@ -413,7 +417,7 @@ nni_stat_sys_init(void)
nni_mtx_init(&stats_lock);
NNI_LIST_INIT(&stats_root.si_children, nni_stat_item, si_node);
stats_root.si_name = "";
stats_root.si_desc = "all statistsics";
stats_root.si_desc = "all statistics";
#endif

return (0);
Expand Down

0 comments on commit 573cdf8

Please sign in to comment.