Skip to content

Commit

Permalink
memory leak fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksei Konovkin authored and Aleksei Konovkin committed Dec 23, 2021
1 parent 3785164 commit 934e4d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ DIR="$(pwd)"
DIAG_DIR="diag"
VCS_PATH=${DIR%/*/*}

VERSION="1.17.6"
ZOO_VERSION="3.5.5"
VERSION="1.20.1"
ZOO_VERSION="3.5.9"
PCRE_VERSION="8.40"
ZLIB_VERSION="1.2.11"

Expand Down Expand Up @@ -202,7 +202,9 @@ function build_zlib() {

function build_zoo() {
echo "Build Zookeeper" | tee -a $BUILD_LOG
cd apache-zookeeper-$ZOO_VERSION/zookeeper-client/zookeeper-client-c
cd apache-zookeeper-$ZOO_VERSION
ant compile_jute
cd zookeeper-client/zookeeper-client-c
autoreconf -if >> $BUILD_LOG 2>>$ERR_LOG
./configure --without-cppunit --prefix="$ZOO_PREFIX" --enable-shared --disable-static --libdir "$ZOO_PREFIX/lib" >> $BUILD_LOG 2>>$ERR_LOG
make -j 8 >> $BUILD_LOG 2>>$ERR_LOG
Expand Down Expand Up @@ -316,7 +318,7 @@ function download() {
cd src

download_dep http://nginx.org/download nginx $VERSION tar.gz
download_dep http://www-us.apache.org/dist/zookeeper/zookeeper-$ZOO_VERSION apache-zookeeper $ZOO_VERSION tar.gz
download_dep http://mirror.linux-ia64.org/apache/zookeeper/zookeeper-$ZOO_VERSION apache-zookeeper $ZOO_VERSION tar.gz
download_dep http://ftp.cs.stanford.edu/pub/exim/pcre pcre $PCRE_VERSION tar.gz
download_dep http://zlib.net zlib $ZLIB_VERSION tar.gz

Expand Down
3 changes: 3 additions & 0 deletions ngx_zookeeper_upstream_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ ngx_zookeeper_upstream_save(ngx_http_zookeeper_upstream_srv_conf_t *zscf)
ngx_rwlock_unlock(&primary->rwlock);
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno,
ngx_open_file_n " \"%V\" failed", &zscf->file);
ngx_destroy_pool(pool);
return;
}

Expand Down Expand Up @@ -785,6 +786,8 @@ ngx_zookeeper_upstream_save(ngx_http_zookeeper_upstream_srv_conf_t *zscf)

ngx_rwlock_unlock(&primary->rwlock);

ngx_destroy_pool(pool);

return;

nomem:
Expand Down

0 comments on commit 934e4d1

Please sign in to comment.