提交 37705f55 编写于 作者: D Dmitry Kozlov

net-snmp: fiexed improper handling of empty username when requesting session table

Signed-off-by: NDmitry Kozlov <xeb@mail.ru>
上级 e4bfe041
......@@ -224,16 +224,16 @@ sessionTable_container_load(netsnmp_container *container)
strcpy(rowreq_ctx->data->ifname, ses->ifname);
if (ses->username)
rowreq_ctx->data->username = strdup(ses->username);
rowreq_ctx->data->username = _strdup(ses->username);
else
ses->username = strdup("");
rowreq_ctx->data->username = _strdup("");
rowreq_ctx->data->peer_addr = ses->ipv4 ? ses->ipv4->peer_addr : 0;
rowreq_ctx->data->type = ses->ctrl->type;
rowreq_ctx->data->state = ses->state;
rowreq_ctx->data->uptime = (ses->stop_time ? ses->stop_time : t) - ses->start_time;
rowreq_ctx->data->calling_sid = strdup(ses->ctrl->calling_station_id);
rowreq_ctx->data->called_sid = strdup(ses->ctrl->called_station_id);
rowreq_ctx->data->calling_sid = _strdup(ses->ctrl->calling_station_id);
rowreq_ctx->data->called_sid = _strdup(ses->ctrl->called_station_id);
CONTAINER_INSERT(container, rowreq_ctx);
++count;
......
......@@ -73,13 +73,13 @@ sessionTable_release_data(sessionTable_data *data)
DEBUGMSGTL(("verbose:sessionTable:sessionTable_release_data","called\n"));
if (data->username)
free(data->username);
_free(data->username);
if (data->calling_sid)
free(data->calling_sid);
_free(data->calling_sid);
if (data->called_sid)
free(data->called_sid);
_free(data->called_sid);
free(data);
} /* sessionTable_release_data */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册