]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
priority: Use gnutls_free consistently
authorEric Blake <eblake@redhat.com>
Fri, 14 Oct 2022 19:02:14 +0000 (14:02 -0500)
committerEric Blake <eblake@redhat.com>
Wed, 2 Nov 2022 17:27:43 +0000 (12:27 -0500)
The whole point of gnutls_calloc() is to allow an alternative to
malloc() where that alternative takes over all aspects of heap
management; as such, it is never safe to pair bare free() with memory
managed by gnutls.  Not to mention that it looks bad to mix calls to
gnutls_free() and free() to the same variable within the same
function.

Signed-off-by: Eric Blake <eblake@redhat.com>
lib/priority.c

index 8ea86d719c41fe4bfd767b9348e933466a6c9aaf..8caf189bc20e306f18b1dda753ba95baa3eec41d 100644 (file)
@@ -3299,7 +3299,7 @@ gnutls_priority_init(gnutls_priority_t * priority_cache,
        ret = GNUTLS_E_INVALID_REQUEST;
 
  error_cleanup:
-       free(darg);
+       gnutls_free(darg);
        gnutls_priority_deinit(*priority_cache);
        *priority_cache = NULL;