Skip to content

Commit

Permalink
SonarCloud, LGTM, packages
Browse files Browse the repository at this point in the history
- Fix memory handling
- Update packages dependencies
  • Loading branch information
jelu committed Apr 4, 2022
1 parent e4fb6aa commit 53c27ca
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions .lgtm.yml
Expand Up @@ -12,6 +12,7 @@ extraction:
- libtool
- pkg-config
- zlib1g-dev
- libmaxminddb-dev
configure:
command:
- ./autogen.sh
Expand Down
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -38,16 +38,19 @@ General support and discussion:
## Dependencies

PacketQ requires a couple of libraries beside a normal C++ compiling
environment with Autoconf and Automake.
environment with autoconf, automake, libtool and pkgconfig.

PacketQ has an optional dependency on the MaxMindDB library (for the
`CC()` and `ASN()` functions).

To install the dependencies under Debian/Ubuntu:
```
apt-get install -y zlib1g-dev
apt-get install -y zlib1g-dev libmaxminddb-dev
```

To install the dependencies under CentOS (with EPEL enabled):
```
yum install -y zlib-devel
yum install -y zlib-devel libmaxminddb-devel
```

## Build from GitHub
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Jerry Lundström <lundstrom.jerry@gmail.com>
Build-Depends: debhelper (>= 10), build-essential, automake, autoconf,
zlib1g-dev, netbase, libtool
zlib1g-dev, netbase, libtool, pkg-config, libmaxminddb-dev
Standards-Version: 3.9.4
Homepage: https://www.dns-oarc.net/tools/packetq
Vcs-Git: https://github.com/DNS-OARC/PacketQ.git
Expand Down
2 changes: 2 additions & 0 deletions rpm/packetq.spec
Expand Up @@ -15,6 +15,8 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: libmaxminddb-devel

%description
packetq is a command line tool to run SQL queries directly on PCAP files,
Expand Down
4 changes: 2 additions & 2 deletions src/sql.cpp
Expand Up @@ -2563,7 +2563,7 @@ Cc_func::Cc_func(const OP& op)
int ret = MMDB_open(db.c_str(), 0, mmdb);
if (ret != MMDB_SUCCESS) {
fprintf(stderr, "Warning: cannot open MaxMind CC database \"%s\": %s\n", db.c_str(), MMDB_strerror(ret));
free(mmdb);
delete mmdb;
return;
}

Expand Down Expand Up @@ -2655,7 +2655,7 @@ Asn_func::Asn_func(const OP& op)
int ret = MMDB_open(db.c_str(), 0, mmdb);
if (ret != MMDB_SUCCESS) {
fprintf(stderr, "Warning: cannot open MaxMind ASN database \"%s\": %s\n", db.c_str(), MMDB_strerror(ret));
free(mmdb);
delete mmdb;
return;
}

Expand Down

0 comments on commit 53c27ca

Please sign in to comment.