Skip to content

Free memory in error case + remove unused function #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2023

Conversation

borisVanhoof
Copy link

Hi,

This code is great. I noticed some very small things and, if correct, maybe you can do something with it.

Kind regards,
Boris

@borisVanhoof
Copy link
Author

I ran some unit tests with make test and make longtest inside the docker container.

Minitdir Report
!! FAILED !! : 00-lint
!! FAILED !! : 01-doc
** PASSED ** : 02-unittest
** PASSED ** : 03-testbound
** PASSED ** : 04-checkconf
** PASSED ** : 05-asynclook
** PASSED ** : 06-ianaports
** PASSED ** : 07-confroot
** PASSED ** : 08-host-lib
** PASSED ** : 09-unbound-control
** PASSED ** : 10-unbound-anchor
!! FAILED !! : acl_interface
** PASSED ** : auth_axfr
** PASSED ** : auth_https
** PASSED ** : blanks_cached_zone
** PASSED ** : blanks_https
.. SKIPPED.. : clang-analysis
** PASSED ** : ctrl_itr
** PASSED ** : ctrl_pipe
.. SKIPPED.. : dnscrypt_cert
.. SKIPPED.. : dnscrypt_cert_chacha
.. SKIPPED.. : dnstap
.. SKIPPED.. : dnstap_reconnect
.. SKIPPED.. : dnstap_tcp
.. SKIPPED.. : dnstap_tls
.. SKIPPED.. : dnstap_tls_badcert
.. SKIPPED.. : dnstap_tls_badname
.. SKIPPED.. : dnstap_tls_clientauth
.. SKIPPED.. : dnstap_tls_peername
.. SKIPPED.. : doh_downstream
.. SKIPPED.. : doh_downstream_buffer_size
.. SKIPPED.. : doh_downstream_endpoint
.. SKIPPED.. : doh_downstream_notls
.. SKIPPED.. : doh_downstream_post
.. SKIPPED.. : dynlibmod
** PASSED ** : ede
!! FAILED !! : edns_cache
!! FAILED !! : fwd_ancil
** PASSED ** : fwd_bogus
** PASSED ** : fwd_capsid
** PASSED ** : fwd_capsid_fallback
** PASSED ** : fwd_capsid_strip
** PASSED ** : fwd_capsid_white
** PASSED ** : fwd_compress_c00c
** PASSED ** : fwd_edns_bksec
** PASSED ** : fwd_edns_probe
** PASSED ** : fwd_malformed
** PASSED ** : fwd_no_edns
** PASSED ** : fwd_oneport
** PASSED ** : fwd_tcp
** PASSED ** : fwd_tcp_tc
!! FAILED !! : fwd_tcp_tc6
** PASSED ** : fwd_three
** PASSED ** : fwd_three_service
** PASSED ** : fwd_ttlexpire
** PASSED ** : fwd_udp
** PASSED ** : fwd_udp_with_tcp_upstream
** PASSED ** : fwd_udptmout
** PASSED ** : fwd_waitudp
** PASSED ** : fwd_zero
** PASSED ** : hostsfileosx
** PASSED ** : http_user_agent
.. SKIPPED.. : ipset
** PASSED ** : local_nodefault
** PASSED ** : local_norec
** PASSED ** : local_nosnoop
.. SKIPPED.. : nss_compile
.. SKIPPED.. : padding
!! FAILED !! : proxy_protocol
.. SKIPPED.. : pylib
.. SKIPPED.. : pymod
.. SKIPPED.. : pymod_thread
** PASSED ** : ratelimit
** PASSED ** : remote-threaded
** PASSED ** : root_anchor
** PASSED ** : root_hints
** PASSED ** : speed_cache
** PASSED ** : speed_local
** PASSED ** : ssl_req_order
** PASSED ** : ssl_req_timeout
** PASSED ** : stat_timer
** PASSED ** : stat_values
** PASSED ** : stream_ssl
** PASSED ** : stream_tcp
** PASSED ** : stub_auth_tc
** PASSED ** : stub_udp
!! FAILED !! : stub_udp6
** PASSED ** : stub_udp_with_tcp_upstream
** PASSED ** : svcb
** PASSED ** : tcp_conn_limit
** PASSED ** : tcp_idle_timeout
** PASSED ** : tcp_req_order
** PASSED ** : tcp_req_size
** PASSED ** : tcp_req_timeout
** PASSED ** : tcp_reuse
** PASSED ** : tcp_sigpipe
** PASSED ** : tls_reuse
** PASSED ** : zonemd_reload
cache-size-1  	average qps: 	156829
cache-suffices	average qps: 	154966
cache-toosmall	average qps: 	22144.4
version-server	average qps: 	225168
localhost-addr	average qps: 	203365

gthess added a commit that referenced this pull request Jul 21, 2023
  mesh_state_delete when erroring out.
gthess added a commit that referenced this pull request Jul 21, 2023
@gthess gthess merged commit 201da1f into NLnetLabs:master Jul 21, 2023
@gthess
Copy link
Member

gthess commented Jul 21, 2023

Thanks for this!
I fixed some mesh_state accounting before calling the introduced mesh_state_delete in the code and also changed netcat-traditional to netcat-openbsd since it seems to be more feature rich.

jedisct1 added a commit to jedisct1/unbound that referenced this pull request Aug 11, 2023
* nlnet/master: (52 commits)
  - Move a cache reply callback in worker.c closer to the cache reply   generation.
  - Fix to use the now cached EDE, if any, for CD_bit queries.
  - More braces and formatting for Fix for EDNS EDE size calculation to   avoid future bugs.
  - Fix for EDNS EDE size calculation.
  - For NLnetLabs#911: Try to trim EXTRA-TEXT (and LDNS_EDE_OTHER options   altogether) before giving up on attaching EDE options.
  - iana portlist update.
  - Merge NLnetLabs#790 from Tom Carpay: Add support for EDE caching in cachedb   and subnetcache.
  - For NLnetLabs#790: Update formatting in cachedb/cachedb.c
  - For NLnetLabs#790: clean testcase.
  - For NLnetLabs#759: fix doc string.
  - Fix unused variable compile warning for kernel timestamps in   netevent.c
  - Review for NLnetLabs#790: Fix memory leak.
  - Review for NLnetLabs#790: Address Wouter's comments.
  - Review for NLnetLabs#790: replace tdir tests with simpler rpl tests.
  Address review comments for NLnetLabs#759: - Clear error text when an expected signature is missing.
  Address review comments for NLnetLabs#759: - Decrease allocations for "" EDE strings when loading the cachedump. - Check for existence of EDE code before attaching.
  - For NLnetLabs#889: Account for num_detached_states before possible   mesh_state_delete when erroring out.
  - For NLnetLabs#889: use netcat-openbsd instead of netcat-traditional.
  - Cleaner failure code for callback functions in interface.i.
  Log established connection to Redis
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants