Skip to content

Commit

Permalink
Fix memory leak (osquery#3553)
Browse files Browse the repository at this point in the history
  • Loading branch information
lxcode authored and trizt committed May 24, 2019
1 parent e8af13c commit a7eae32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osquery/tables/system/freebsd/pkg_packages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ QueryData genPkgPackages(QueryContext& context) {
VLOG(1) << "Cannot open pkgdb: " << rc << " "
<< getStringForSQLiteReturnCode(rc);
if (db != nullptr) {
free(db);
sqlite3_close(db);
}
}

Expand All @@ -75,7 +75,7 @@ QueryData genPkgPackages(QueryContext& context) {

// Clean up.
sqlite3_finalize(stmt);
free(db);
sqlite3_close(db);

return results;
}
Expand Down

0 comments on commit a7eae32

Please sign in to comment.