Skip to content

Commit

Permalink
mod_sonic: ifAlias memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Apr 1, 2021
1 parent 7a397bd commit dc692de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hsflowd.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: host sFlow daemon
Name: hsflowd
Version: 2.0.34
Release: 2
Release: 3
License: http://sflow.net/license.html
Group: Applications/Internet
URL: http://sflow.net
Expand Down
5 changes: 4 additions & 1 deletion src/Linux/mod_sonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,11 @@ extern "C" {
// This "index" field is neither ifIndex nor osIndex, so ignore it.
if(my_strequal(c_name->str, HSP_SONIC_FIELD_IFSPEED))
prt->ifSpeed = db_getU64(c_val) * HSP_SONIC_FIELD_IFSPEED_UNITS;
if(my_strequal(c_name->str, HSP_SONIC_FIELD_IFALIAS))
if(my_strequal(c_name->str, HSP_SONIC_FIELD_IFALIAS)) {
if(prt->ifAlias)
my_free(prt->ifAlias);
prt->ifAlias = my_strdup(c_val->str);
}
if(my_strequal(c_name->str, HSP_SONIC_FIELD_IFADMINSTATUS))
prt->adminUp = my_strequal(c_val->str, "up");
if(my_strequal(c_name->str, HSP_SONIC_FIELD_IFOPERSTATUS))
Expand Down

0 comments on commit dc692de

Please sign in to comment.