mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-14 01:30:19 +00:00
Use glib for all allocations
- Removes need to check for malloc failure - Removes need for NULL checks on free - Adds checks for integer overflows - Removes some extra memset calls - Removes chance of mixing libc and glib malloc/free
This commit is contained in:
@@ -504,9 +504,7 @@ _SSL_check_common_name (X509 *cert, const char *host)
|
||||
if (common_name_len < 0)
|
||||
return -1;
|
||||
|
||||
common_name = calloc (common_name_len + 1, 1);
|
||||
if (common_name == NULL)
|
||||
return -1;
|
||||
common_name = g_malloc0 (common_name_len + 1);
|
||||
|
||||
X509_NAME_get_text_by_NID (name, NID_commonName, common_name, common_name_len + 1);
|
||||
|
||||
@@ -535,7 +533,7 @@ _SSL_check_common_name (X509 *cert, const char *host)
|
||||
rv = 0;
|
||||
|
||||
out:
|
||||
free(common_name);
|
||||
g_free(common_name);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user