Fix a resource leak by closing skf before return

This commit is contained in:
yuanjungong 2021-06-09 09:35:27 +08:00 committed by Wireshark GitLab Utility
parent ca42e4a9ad
commit e0d420ac48
2 changed files with 2 additions and 0 deletions

View File

@ -2313,6 +2313,7 @@ read_keytab_file(const char *service_key_file)
service_key_list = g_slist_append(service_key_list, (gpointer) sk);
if (fseek(skf, newline_skip, SEEK_CUR) < 0) {
fprintf(stderr, "unable to seek...\n");
fclose(skf);
return;
}
count++;

View File

@ -2756,6 +2756,7 @@ read_keytab_file(const char *service_key_file)
service_key_list = g_slist_append(service_key_list, (gpointer) sk);
if (fseek(skf, newline_skip, SEEK_CUR) < 0) {
fprintf(stderr, "unable to seek...\n");
fclose(skf);
return;
}
count++;