mirror of
https://github.com/yarrick/iodine.git
synced 2025-08-24 12:08:20 +00:00
fixed memleak on failure
This commit is contained in:
@@ -363,6 +363,7 @@ dns_encode_hostname(const char *host, char *buffer, int size)
|
|||||||
word = strtok(h, ".");
|
word = strtok(h, ".");
|
||||||
while(word) {
|
while(word) {
|
||||||
if (strlen(word) > 63 || strlen(word) > left) {
|
if (strlen(word) > 63 || strlen(word) > left) {
|
||||||
|
free(h);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
left -= (strlen(word) + 1);
|
left -= (strlen(word) + 1);
|
||||||
|
Reference in New Issue
Block a user