GnuTLS | rnd: use matching allocator for gnutls_free (!2058)

Read-only notification of GnuTLS library development activities <[email protected]>
Newsgroups gmane.comp.encryption.gpg.gnutls.devel
Message-ID <[email protected]>

Daiki Ueno created a merge request: https://gitlab.com/gnutls/gnutls/-/merge_requests/2058

Project:Branches: dueno/gnutls:wip/dueno/gcc-analyzer-fixes to gnutls/gnutls:master
Author:   Daiki Ueno



<!-- Add a description of the new feature/bug fix. Reference any relevant bugs. -->

* ocsp: suppress false-positive reported by GCC 15 analyzer

GCC 15 analyzer reports:
```
  ocsp.c:2470:17: warning: dereference of NULL '*ocsps' [CWE-476] [-Wanalyzer-null-dereference]
   2470 |                 gnutls_ocsp_resp_deinit((*ocsps)[i]);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
`*ocsps` should always be non-NULL when this part is exercised. This
adds an assertion for that.

* dane: use matching deallocator for gnutls_malloc

Spotted by GCC analyzer:
```
  dane.c:972:17: warning: memory allocated with 'gnutls_malloc' should be deallocated with 'free' but was deallocated with 'free'
    972 |                 free(new_cert_list);
        |                 ^~~~~~~~~~~~~~~~~~~
```

* rnd: use matching allocator for gnutls_free

## Checklist
 * [x] Commits have `Signed-off-by:` with name/author being identical to the commit author
 * [ ] Code modified for feature
 * [ ] Test suite updated with functionality tests
 * [ ] Test suite updated with negative tests
 * [ ] Documentation updated / NEWS entry present (for non-trivial changes)

## Reviewer's checklist:
 * [ ] Any issues marked for closing are addressed
 * [ ] There is a test suite reasonably covering new functionality or modifications
 * [ ] Function naming, parameters, return values, types, etc., are consistent and according to `CONTRIBUTION.md`
 * [ ] This feature/change has adequate documentation added
 * [ ] No obvious mistakes in the code

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/2058
You're receiving this email because of your account on gitlab.com.

_______________________________________________
Gnutls-devel mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.