diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-04-30 13:25:53 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-04-30 13:25:53 +0400 |
commit | 37705f55845c639292ddc2ecd674c9cdc7add361 (patch) | |
tree | 53546d06fb8a250b6d73110fb2f852b1004a296d /accel-pppd | |
parent | e4bfe041eba9a46f5d3c048ab9143cfea2f64da9 (diff) | |
download | accel-ppp-37705f55845c639292ddc2ecd674c9cdc7add361.tar.gz accel-ppp-37705f55845c639292ddc2ecd674c9cdc7add361.zip |
net-snmp: fiexed improper handling of empty username when requesting session table
Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/extra/net-snmp/sessionTable_data_access.c | 8 | ||||
-rw-r--r-- | accel-pppd/extra/net-snmp/sessionTable_data_get.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/accel-pppd/extra/net-snmp/sessionTable_data_access.c b/accel-pppd/extra/net-snmp/sessionTable_data_access.c index a6046ae2..8ec4aa60 100644 --- a/accel-pppd/extra/net-snmp/sessionTable_data_access.c +++ b/accel-pppd/extra/net-snmp/sessionTable_data_access.c @@ -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; diff --git a/accel-pppd/extra/net-snmp/sessionTable_data_get.c b/accel-pppd/extra/net-snmp/sessionTable_data_get.c index 1dcea1e8..264b2d84 100644 --- a/accel-pppd/extra/net-snmp/sessionTable_data_get.c +++ b/accel-pppd/extra/net-snmp/sessionTable_data_get.c @@ -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 */ |