Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Network: Fix memory leak pointed by coverity.
Browse files Browse the repository at this point in the history
The name variable must be freed.

Signed-off-by: Guilherme Iscaro <[email protected]>
  • Loading branch information
cabelitos committed Mar 30, 2016
1 parent b3c859b commit bc87c97
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/modules/flow/network/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ _match_link(const struct network_data *mdata, const struct sol_network_link *lin
const char *p = name;
regmatch_t m;

if (!mdata->regex_initialized)
return false;

if (!name)
return false;
if (!regexec(&mdata->regex, p, 1, &m, 0)) {

if (mdata->regex_initialized && !regexec(&mdata->regex, p, 1, &m, 0)) {
free(name);
return true;
}
Expand Down

0 comments on commit bc87c97

Please sign in to comment.