<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<div>
<blockquote dir="auto">
<p>Well, <code>_gnutls_resolve_priorities()</code> is only used in tests/system-prio-file.c and not meant as a public function. That function can also be directly reached/tested through <code>gnutls_priority_init()</code>. Am I wrong ?
If that is possible, we don't have to expose <code>_gnutls_resolve_priorities()</code> at all.</p>
</blockquote>
<p dir="auto">The reason of it being exported (as internal symbol), is for unit testing. It is not available to applications.</p>
<blockquote dir="auto">
<p>Also, instead of strdup() we can use gnutls_strdup(). Regarding <code>getline()</code>: the use of this function <em>may</em> cause issues since you can't limit the length of the input. It may be reasonable to limit the input (whatever makes sense here, 1k, 4k, 32k ?). Doing so we can use gnutls_free().</p>
</blockquote>
<p dir="auto">I'm not sure if there is really a concern here (loading the system-wide config), but that could indeed be a way to use <code>gnutls_free</code> here.</p>
<blockquote dir="auto">
<p>And then... the issue with free() vs. gnutls_free() occurs on Windows only (AFAIK). Since Windows doesn't provide getline(), it will be taken from gnulib and thus the code is inside the gnutls DLL. And that allows calling gnutls_free().</p>
</blockquote>
<p dir="auto">That would not be the case if the application has replaced the allocation functions. The original/historical reason for <code>gnutls_free</code> and <code>gnutls_malloc</code> was so that applications could (in theory) override them. Today is mostly windows and leaving the possibility open to moving to another allocator in the future (e.g., talloc).</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/merge_requests/742#note_101731985">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/9d1a0f51d90bf58fc4cb1806df967308/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.com/gnutls/gnutls/merge_requests/742#note_101731985"}}</script>
</p>
</div>
</body>
</html>