summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/krb/parse.c
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-01-19 17:11:15 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-01-19 17:11:15 +0000
commitb399c85d970c19c94e6adec4258171246c9e0d70 (patch)
treec1936a1aa5a43a35f2e84e8de6e3b456f75a667d /src/lib/krb5/krb/parse.c
parenta7ea3bf40b7a8962edbea307f612c154f900df71 (diff)
downloadkrb5-b399c85d970c19c94e6adec4258171246c9e0d70.tar.gz
krb5-b399c85d970c19c94e6adec4258171246c9e0d70.tar.xz
krb5-b399c85d970c19c94e6adec4258171246c9e0d70.zip
use xfree to cast values
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@148 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/parse.c')
-rw-r--r--src/lib/krb5/krb/parse.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c
index 70d63159bc..3ee567ed86 100644
--- a/src/lib/krb5/krb/parse.c
+++ b/src/lib/krb5/krb/parse.c
@@ -44,6 +44,9 @@ extern char *malloc(), *index(), *calloc();
#define COMPONENT_SEP '/'
#define MAXRLMSZ 256 /* XXX! */
+
+#define xfree(val) free((char *)val)
+
static char *
strsave(string)
char *string;
@@ -76,7 +79,7 @@ krb5_principal *principal;
if (!realmname)
return(ENOMEM);
if (retval = krb5_get_default_realm(MAXRLMSZ, realmname)) {
- free(realmname);
+ xfree(realmname);
return(retval);
}
}
@@ -89,16 +92,16 @@ krb5_principal *principal;
/* +1 for realm, +1 for null pointer at end */
retprinc = (krb5_data **) calloc(ncomponents+2, sizeof(krb5_data *));
if (!retprinc) {
- free(realmname);
+ xfree(realmname);
return(ENOMEM);
}
retprinc[ncomponents+1] = 0;
for (i = 0; i <= ncomponents; i++) {
if (!(retprinc[i] = (krb5_data *) malloc(sizeof(krb5_data)))) {
for (i--; i >= 0; i--)
- free(retprinc[i]);
- free(retprinc);
- free(realmname);
+ xfree(retprinc[i]);
+ xfree(retprinc);
+ xfree(realmname);
return(ENOMEM);
}
}
@@ -127,12 +130,12 @@ krb5_principal *principal;
if (!(retprinc[ncomponents]->data =
malloc(retprinc[ncomponents]->length+1))) {
/* ut oh...clean up */
- free(retprinc[ncomponents]);
+ xfree(retprinc[ncomponents]);
for (ncomponents--; ncomponents >= 0; ncomponents--) {
- free(retprinc[ncomponents]->data);
- free(retprinc[ncomponents]);
+ xfree(retprinc[ncomponents]->data);
+ xfree(retprinc[ncomponents]);
}
- free(retprinc);
+ xfree(retprinc);
return(ENOMEM);
}
strncpy(retprinc[ncomponents]->data, cp2,