diff -Nru libhbaapi-2.2.10/CMakeLists.txt libhbaapi-2.2.10/CMakeLists.txt --- libhbaapi-2.2.10/CMakeLists.txt 2017-06-07 09:49:50.000000000 +0000 +++ libhbaapi-2.2.10/CMakeLists.txt 2017-06-10 20:40:01.000000000 +0000 @@ -1,4 +1,4 @@ -PROJECT (hbaapi) +PROJECT (hbaapi C) CMAKE_MINIMUM_REQUIRED (VERSION 2.8) OPTION (ENABLE_SO_VERSION "Enable so version" ON) diff -Nru libhbaapi-2.2.10/debian/changelog libhbaapi-2.2.10/debian/changelog --- libhbaapi-2.2.10/debian/changelog 2017-06-07 10:06:44.000000000 +0000 +++ libhbaapi-2.2.10/debian/changelog 2018-08-17 07:47:51.000000000 +0000 @@ -1,4 +1,10 @@ -libhbaapi (2.2.10-2~xenial) xenial; urgency=low +libhbaapi (2.2.10-3~xenial) xenial; urgency=medium + + * close FILE handle before return. + + -- Like Ma Fri, 17 Aug 2018 15:43:02 +0800 + +libhbaapi (2.2.10-2) unstable; urgency=low * Link against dl in *nix. diff -Nru libhbaapi-2.2.10/.gitlab-ci.yml libhbaapi-2.2.10/.gitlab-ci.yml --- libhbaapi-2.2.10/.gitlab-ci.yml 2017-04-06 06:39:19.000000000 +0000 +++ libhbaapi-2.2.10/.gitlab-ci.yml 2018-08-17 07:44:22.000000000 +0000 @@ -2,6 +2,9 @@ stages: - build +variables: + DEBIAN_FRONTEND: noninteractive + before_script: - mkdir -p ~/.ssh - echo -e "host scutech-debrep\nHostName 192.168.88.10\nPort 8222\nUser debrep\nStrictHostKeyChecking no\n" > ~/.ssh/config @@ -9,9 +12,11 @@ - chmod -R og-rwx ~/.ssh after_script: - - echo -e "[scutech-ppa]\nfqdn = scutech-debrep\nmethod = scp\nincoming = ~/upload\nallow_unsigned_uploads = 1\nlogin =\n" >> /etc/dput.cf + - echo -e "[scutech-unstable-ppa]\nfqdn = scutech-debrep\nmethod = scp\nincoming = ~/unstable/upload\nallow_unsigned_uploads = 1\nlogin =\n" >> /etc/dput.cf + - echo -e "[scutech-stable-ppa]\nfqdn = scutech-debrep\nmethod = scp\nincoming = ~/stable/upload\nallow_unsigned_uploads = 1\nlogin =\n" >> /etc/dput.cf - sed -i 's/^\(default_host_main[[:blank:]]\+=\).*/\1 scutech-ppa/' /etc/dput.cf - - dput -f ../*.changes + - dput -f scutech-unstable-ppa ../*.changes + - dput -f scutech-stable-ppa ../*.changes debian-squeeze-amd64: image: 192.168.88.11:5000/debian:squeeze @@ -21,7 +26,7 @@ - echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf - apt-get update -y - apt-get dist-upgrade -y --force-yes - - apt-get install -y debhelper cmake dput + - apt-get install -y --force-yes debhelper cmake dput - sed -i -e '1 s/\S\+;/squeeze;/' -e 's/~[^)]\+//' -e 's/)/~squeeze)/' debian/changelog - dpkg-buildpackage -uc -us @@ -33,7 +38,7 @@ - echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf - apt-get update -y - apt-get dist-upgrade -y --force-yes - - apt-get install -y debhelper cmake dput + - apt-get install -y --force-yes debhelper cmake dput - sed -i -e '1 s/\S\+;/squeeze;/' -e 's/~[^)]\+//' -e 's/)/~squeeze)/' debian/changelog - dpkg-buildpackage -uc -us -b @@ -44,7 +49,7 @@ - echo -e "deb http://debian.ustc.edu.cn/debian wheezy main contrib non-free\ndeb http://debian.ustc.edu.cn/debian-security wheezy/updates main contrib non-free\n" > /etc/apt/sources.list - apt-get update -y - apt-get dist-upgrade -y --force-yes - - apt-get install -y debhelper cmake dput + - apt-get install -y --force-yes debhelper cmake dput - sed -i -e '1 s/\S\+;/wheezy;/' -e 's/~[^)]\+//' -e 's/)/~wheezy)/' debian/changelog - dpkg-buildpackage -uc -us @@ -55,6 +60,30 @@ - echo -e "deb http://mirrors.ustc.edu.cn/debian jessie main contrib non-free\ndeb http://mirrors.ustc.edu.cn/debian jessie-proposed-updates main contrib non-free\ndeb http://mirrors.ustc.edu.cn/debian jessie-updates main contrib non-free\ndeb http://security.debian.org jessie/updates main\n" > /etc/apt/sources.list - apt-get update -y - apt-get dist-upgrade -y --force-yes - - apt-get install -y debhelper cmake dput openssh-client - - sed -i -e '1 s/\S\+;/jessie;/' -e 's/~[^)]\+//' -e 's/)/~jessie)/' -e 's/\-[0-9]\+//g' debian/changelog + - apt-get install -y --force-yes debhelper cmake dput openssh-client + - sed -i -e '1 s/\S\+;/jessie;/' -e 's/~[^)]\+//' -e 's/)/~jessie)/' -e 's/\-\([0-9]\+\)/.\1/g' debian/changelog - dpkg-buildpackage -uc -us + +ubuntu-utopic-arm64: + image: 192.168.88.11:5000/ubuntu:utopic + stage: build + script: + - echo -e "deb [arch=amd64,arm64] $OLD_RELEASE_UBUNTU_REPO_URL utopic main restricted universe multiverse\ndeb [arch=amd64,arm64] $OLD_RELEASE_UBUNTU_REPO_URL utopic-updates main restricted universe multiverse\ndeb [arch=amd64,arm64] $OLD_RELEASE_UBUNTU_REPO_URL utopic-security main restricted universe multiverse\n" > /etc/apt/sources.list + - dpkg --add-architecture arm64 + - apt-get update -y + - apt-get dist-upgrade -y --force-yes + - apt-get install -y --force-yes gcc-aarch64-linux-gnu debhelper cmake dput openssh-client libc6:arm64 + - sed -i -e '1 s/\S\+;/utopic;/' -e 's/~[^)]\+//' -e 's/)/~utopic)/' debian/changelog + - CC=aarch64-linux-gnu-gcc dpkg-buildpackage -uc -us -aarm64 -b + +ubuntu-xenial-arm64: + image: 192.168.88.11:5000/ubuntu:xenial + stage: build + script: + - echo -e "deb [arch=amd64] $UBUNTU_REPO_URL xenial main restricted universe multiverse\ndeb [arch=amd64] $UBUNTU_REPO_URL xenial-updates main restricted universe multiverse\ndeb [arch=amd64] $UBUNTU_REPO_URL xenial-security main restricted universe multiverse\ndeb [arch=arm64] $UBUNTU_PORTS_REPO_URL xenial main restricted universe multiverse\ndeb [arch=arm64] $UBUNTU_PORTS_REPO_URL xenial-updates main restricted universe multiverse\ndeb [arch=arm64] $UBUNTU_PORTS_REPO_URL xenial-security main restricted universe multiverse\n" > /etc/apt/sources.list + - dpkg --add-architecture arm64 + - apt-get update -y + - apt-get dist-upgrade -y --force-yes + - apt-get install -y --force-yes gcc-aarch64-linux-gnu debhelper cmake dput openssh-client libc6:arm64 + - sed -i -e '1 s/\S\+;/xenial;/' -e 's/~[^)]\+//' -e 's/)/~xenial)/' debian/changelog + - CC=aarch64-linux-gnu-gcc dpkg-buildpackage -uc -us -aarm64 -b diff -Nru libhbaapi-2.2.10/HBAAPILIB.c libhbaapi-2.2.10/HBAAPILIB.c --- libhbaapi-2.2.10/HBAAPILIB.c 2017-04-03 19:52:57.000000000 +0000 +++ libhbaapi-2.2.10/HBAAPILIB.c 2018-08-17 07:44:22.000000000 +0000 @@ -736,6 +736,7 @@ lib_infop = (HBA_LIBRARY_INFO *)calloc(1, sizeof(HBA_LIBRARY_INFO)); if(lib_infop == NULL) { fprintf(stderr, "HBA_LoadLibrary: out of memeory\n"); + fclose(hbaconf); return(HBA_STATUS_ERROR); } lib_infop->status = HBA_LIBRARY_NOT_LOADED; @@ -830,6 +831,7 @@ /* successfully loaded library */ lib_infop->status = HBA_LIBRARY_LOADED; } + fclose(hbaconf); #endif /* WIN32 or UNIX */ #ifdef POSIX_THREADS ret = pthread_mutex_init(&_hbaapi_LL_mutex, NULL);