]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Use the portability layer and close a memory leak
authorRuss Allbery <rra@stanford.edu>
Thu, 19 Sep 2013 04:27:43 +0000 (21:27 -0700)
committerRuss Allbery <rra@stanford.edu>
Thu, 19 Sep 2013 06:13:35 +0000 (23:13 -0700)
Free the unparsed principal name when checking passwords in
Heimdal, and use the portability layer in the external strength
program.

external/heimdal-strength.c
plugin/heimdal.c

index 613a9b4c891db3295bc958fe6f7b3470bc6be15d..d0f4e266a7d8a08239a173396bd7a28138f44262 100644 (file)
@@ -115,7 +115,7 @@ initialize(void)
         exit(1);
     }
     if (realm != NULL) {
-        free(realm);
+        krb5_free_default_realm(ctx, realm);
         free_realm(&realm_data);
     }
     if (pwcheck_init(&context, dictionary) != 0) {
index f02aa504a3d8d011ad4d5c76dcc8e71d1352a3cc..6fe332d0f2ce698f24da071ff580a229d78414d4 100644 (file)
@@ -103,6 +103,7 @@ heimdal_pwcheck(krb5_context context, krb5_principal principal,
         return 1;
     }
     result = pwcheck_check(data, pastring, name, message, length);
+    krb5_free_unparsed_name(ctx, name);
     free(pastring);
     pwcheck_close(data);
     return result;