Fix issue introduced in 20886264fe
authorTim Rühsen <tim.ruehsen@gmx.de>
Tue, 18 Sep 2018 13:35:20 +0000 (15:35 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 20 Sep 2018 13:20:58 +0000 (13:20 +0000)
This makes _gnutls_resolve_priorities() return a string that is always
allocated with the gnutls memory functions.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
lib/priority.c
tests/system-prio-file.c

index 1991635d8638594b4addd031067b435d8098711d..6a4ccc2f463ce7039eca6f7a9e96b3371fef3e7f 100644 (file)
@@ -1056,7 +1056,7 @@ void _gnutls_unload_system_priorities(void)
  * priorities, appended with any additional present in
  * the priorities string.
  *
- * The returned string must be released using free().
+ * The returned string must be released using gnutls_free().
  */
 char *_gnutls_resolve_priorities(const char* priorities)
 {
@@ -1140,7 +1140,7 @@ size_t n, n2 = 0, line_size;
                if (additional)
                        n2 = strlen(additional);
 
-               ret = malloc(n+n2+1+1);
+               ret = gnutls_malloc(n+n2+1+1);
                if (ret == NULL) {
                        goto finish;
                }
@@ -1859,7 +1859,7 @@ gnutls_priority_init(gnutls_priority_t * priority_cache,
                goto error_cleanup;
        }
 
-       free(darg);
+       gnutls_free(darg);
 
        return 0;
 
index e0dfa9460cb2d2e945db9648a0e45acd67eb1601..4368bd00189ea883a88a04fb0f30636735c00173 100644 (file)
@@ -57,7 +57,7 @@ try_prio(const char *prio, const char *expected_str)
        }
 
  ok:
-       free(p);
+       gnutls_free(p);
        gnutls_global_deinit();
 }
 
@@ -84,4 +84,3 @@ void doit(void)
        try_prio("@HELLONO:+AES-128-CBC", NULL);
        try_prio("@HELLONO,:+AES-128-CBC", NULL);
 }
-