Skip to content

Commit

Permalink
Fixed invalid use of ndpi_free(). Sorry, my fault. (#1988)
Browse files Browse the repository at this point in the history
* Fixed invalid use of ndpi_free(). Sorry, my fault.

Signed-off-by: Toni Uhlig <[email protected]>

* Fine tuned symbol check script.

 * added check for expected syms in modules

Signed-off-by: Toni Uhlig <[email protected]>

---------

Signed-off-by: Toni Uhlig <[email protected]>
  • Loading branch information
utoni committed May 24, 2023
1 parent f692342 commit 334b435
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/third_party/src/gcrypt/aesni.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int mbedtls_aesni_has_support( unsigned int what )
break; /* We giveup */
}

ndpi_free(line);
free(line); // Do not replace with ndpi_free(). See `man 3 getline`.
fclose(fd);

has_aesni_checked = 1;
Expand Down
16 changes: 15 additions & 1 deletion utils/check_symbols.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@ for line in `nm -P -u "${NDPI_LIB}"`; do
if [ ! -z "${FOUND_SYMBOL}" ]; then
SKIP=0
case "${CURRENT_OBJECT}" in
'[ndpi_utils.o]'|'[ndpi_memory.o]'|'[roaring.o]') SKIP=1 ;;
'[roaring.o]')
case "${FOUND_SYMBOL}" in
'malloc'|'calloc'|'realloc'|'free') SKIP=1 ;;
esac
;;
'[ndpi_utils.o]'|'[ndpi_memory.o]'|'[roaring.o]')
case "${FOUND_SYMBOL}" in
'malloc'|'calloc'|'free') SKIP=1 ;;
esac
;;
'[gcrypt_light.o]')
case "${FOUND_SYMBOL}" in
'free') SKIP=1 ;;
esac
;;
esac

if [ ${SKIP} -eq 0 ]; then
Expand Down

0 comments on commit 334b435

Please sign in to comment.