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

Commit bc87c97

Browse files
committed
Network: Fix memory leak pointed by coverity.
The name variable must be freed. Signed-off-by: Guilherme Iscaro <[email protected]>
1 parent b3c859b commit bc87c97

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/modules/flow/network/network.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,10 @@ _match_link(const struct network_data *mdata, const struct sol_network_link *lin
7474
const char *p = name;
7575
regmatch_t m;
7676

77-
if (!mdata->regex_initialized)
78-
return false;
79-
8077
if (!name)
8178
return false;
82-
if (!regexec(&mdata->regex, p, 1, &m, 0)) {
79+
80+
if (mdata->regex_initialized && !regexec(&mdata->regex, p, 1, &m, 0)) {
8381
free(name);
8482
return true;
8583
}

0 commit comments

Comments
 (0)