svn rev #21870: trunk/src/ appl/gssftp/ftp/ appl/gssftp/ftpd/ kadmin/ktutil/ ...
raeburn@MIT.EDU
raeburn at MIT.EDU
Mon Feb 2 16:13:46 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21870
Commit By: raeburn
Log Message:
Get rid of casts of free() argument to char*, except where it's
casting away const (so as to make this change warning-neutral), and in
unicode source (which we may want to keep in sync with another
source), and krb5_xfree macro (to be handled separately).
Changed Files:
U trunk/src/appl/gssftp/ftp/cmds.c
U trunk/src/appl/gssftp/ftpd/ftpcmd.y
U trunk/src/appl/gssftp/ftpd/popen.c
U trunk/src/kadmin/ktutil/ktutil_funcs.c
U trunk/src/kdc/kdc_util.c
U trunk/src/lib/krb5/ccache/cc_file.c
U trunk/src/lib/krb5/ccache/cc_keyring.c
U trunk/src/lib/krb5/krb/copy_princ.c
U trunk/src/lib/krb5/krb/parse.c
U trunk/src/lib/krb5/rcache/rc_base.c
U trunk/src/lib/krb5/rcache/rc_conv.c
U trunk/src/lib/krb5/rcache/rc_io.c
U trunk/src/tests/verify/kdb5_verify.c
U trunk/src/util/ss/invocation.c
Modified: trunk/src/appl/gssftp/ftp/cmds.c
===================================================================
--- trunk/src/appl/gssftp/ftp/cmds.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/appl/gssftp/ftp/cmds.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -796,7 +796,7 @@
printf("%s\n", globerr);
if (gargs) {
blkfree(gargs);
- free((char *)gargs);
+ free(gargs);
}
continue;
}
@@ -818,7 +818,7 @@
}
if (gargs != NULL) {
blkfree(gargs);
- free((char *)gargs);
+ free(gargs);
}
}
(void) signal(SIGINT, oldintr);
@@ -1959,7 +1959,7 @@
printf("%s: %s\n", *cpp, globerr);
if (globbed) {
blkfree(globbed);
- free((char *)globbed);
+ free(globbed);
}
return (0);
}
@@ -1969,7 +1969,7 @@
/* don't waste too much memory */
if (*globbed) {
blkfree(globbed1);
- free((char *)globbed);
+ free(globbed);
}
}
return (1);
Modified: trunk/src/appl/gssftp/ftpd/ftpcmd.y
===================================================================
--- trunk/src/appl/gssftp/ftpd/ftpcmd.y 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/appl/gssftp/ftpd/ftpcmd.y 2009-02-02 21:13:42 UTC (rev 21870)
@@ -200,12 +200,12 @@
cmd: USER SP username CRLF
{
user((char *) $3);
- free((char *) $3);
+ free($3);
}
| PASS SP password CRLF
{
pass((char *) $3);
- free((char *) $3);
+ free($3);
}
| PORT SP host_port CRLF
{
@@ -349,21 +349,21 @@
if ($2 && $4 != NULL)
retrieve((char *) 0, (char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| STOR check_login SP pathname CRLF
{
if ($2 && $4 != NULL)
store_file((char *) $4, "w", 0);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| APPE check_login SP pathname CRLF
{
if ($2 && $4 != NULL)
store_file((char *) $4, "a", 0);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| NLST check_login CRLF
{
@@ -375,7 +375,7 @@
if ($2 && $4 != NULL)
send_file_list((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| LIST check_login CRLF
{
@@ -387,14 +387,14 @@
if ($2 && $4 != NULL)
retrieve("/bin/ls -lgA %s", (char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| STAT check_login SP pathname CRLF
{
if ($2 && $4 != NULL)
statfilecmd((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| STAT CRLF
{
@@ -405,7 +405,7 @@
if ($2 && $4 != NULL)
delete_file((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| RNTO SP pathname CRLF
{
@@ -416,7 +416,7 @@
} else {
reply(503, "Bad sequence of commands.");
}
- free((char *) $3);
+ free($3);
}
| ABOR CRLF
{
@@ -432,7 +432,7 @@
if ($2 && $4 != NULL)
cwd((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| HELP CRLF
{
@@ -462,14 +462,14 @@
if ($2 && $4 != NULL)
makedir((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| RMD nonguest SP pathname CRLF
{
if ($2 && $4 != NULL)
removedir((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| PWD check_login CRLF
{
@@ -526,7 +526,7 @@
reply(200, "CHMOD command successful.");
}
if ($8 != NULL)
- free((char *) $8);
+ free($8);
}
| SITE SP IDLE CRLF
{
@@ -553,7 +553,7 @@
if ($2 && $4 != NULL)
store_file((char *) $4, "w", 1);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| SYST CRLF
{
@@ -584,7 +584,7 @@
if ($2 && $4 != NULL)
sizecmd((char *) $4);
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
/*
@@ -617,7 +617,7 @@
}
}
if ($4 != NULL)
- free((char *) $4);
+ free($4);
}
| AUTH SP STRING CRLF
{
@@ -626,7 +626,7 @@
| ADAT SP STRING CRLF
{
auth_data((char *) $3);
- free((char *) $3);
+ free($3);
}
| QUIT CRLF
{
@@ -644,7 +644,7 @@
if ($2 && $4) {
fromname = renamefrom((char *) $4);
if (fromname == (char *) 0 && $4) {
- free((char *) $4);
+ free($4);
}
}
}
@@ -803,10 +803,10 @@
$$ = $1;
else {
reply(550, "%s", globerr);
- free((char *) $1);
+ free($1);
}
} else
- free((char *) $1);
+ free($1);
} else
$$ = $1;
}
Modified: trunk/src/appl/gssftp/ftpd/popen.c
===================================================================
--- trunk/src/appl/gssftp/ftpd/popen.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/appl/gssftp/ftpd/popen.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -142,7 +142,7 @@
pfree: for (argc = 1; argv[argc] != NULL; argc++) {
blkfree((char **)argv[argc]);
- free((char *)argv[argc]);
+ free(argv[argc]);
}
return(iop);
}
Modified: trunk/src/kadmin/ktutil/ktutil_funcs.c
===================================================================
--- trunk/src/kadmin/ktutil/ktutil_funcs.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/kadmin/ktutil/ktutil_funcs.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -43,12 +43,12 @@
for (lp = list; lp;) {
retval = krb5_kt_free_entry(context, lp->entry);
- free((char *)lp->entry);
+ free(lp->entry);
if (retval)
break;
prev = lp;
lp = lp->next;
- free((char *)prev);
+ free(prev);
}
return retval;
}
@@ -283,7 +283,7 @@
lp->entry = entry;
}
if (entry)
- free((char *)entry);
+ free(entry);
if (retval) {
if (retval == KRB5_KT_END)
retval = 0;
Modified: trunk/src/kdc/kdc_util.c
===================================================================
--- trunk/src/kdc/kdc_util.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/kdc/kdc_util.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -145,7 +145,7 @@
*retdata[i] = **ptr;
if (!(retdata[i]->contents =
(krb5_octet *)malloc(retdata[i]->length))) {
- free((char *)retdata[i]);
+ free(retdata[i]);
retdata[i] = 0;
krb5_free_authdata(kdc_context, retdata);
return ENOMEM;
Modified: trunk/src/lib/krb5/ccache/cc_file.c
===================================================================
--- trunk/src/lib/krb5/ccache/cc_file.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/ccache/cc_file.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -506,7 +506,7 @@
}
tmpprinc->data = ALLOC (msize, krb5_data);
if (tmpprinc->data == 0) {
- free((char *)tmpprinc);
+ free(tmpprinc);
return KRB5_CC_NOMEM;
}
} else
@@ -531,8 +531,8 @@
while(--i >= 0)
free(krb5_princ_component(context, tmpprinc, i)->data);
free(krb5_princ_realm(context, tmpprinc)->data);
- free((char *)tmpprinc->data);
- free((char *)tmpprinc);
+ free(tmpprinc->data);
+ free(tmpprinc);
return kret;
}
Modified: trunk/src/lib/krb5/ccache/cc_keyring.c
===================================================================
--- trunk/src/lib/krb5/ccache/cc_keyring.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/ccache/cc_keyring.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -1388,7 +1388,7 @@
}
tmpprinc->data = ALLOC(msize, krb5_data);
if (tmpprinc->data == 0) {
- free((char *) tmpprinc);
+ free(tmpprinc);
return KRB5_CC_NOMEM;
}
} else
@@ -1415,8 +1415,8 @@
while (--i >= 0)
free(krb5_princ_component(context, tmpprinc, i)->data);
free(krb5_princ_realm(context, tmpprinc)->data);
- free((char *) tmpprinc->data);
- free((char *) tmpprinc);
+ free(tmpprinc->data);
+ free(tmpprinc);
return kret;
}
Modified: trunk/src/lib/krb5/krb/copy_princ.c
===================================================================
--- trunk/src/lib/krb5/krb/copy_princ.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/krb/copy_princ.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -49,7 +49,7 @@
tempprinc->data = malloc(nelems * sizeof(krb5_data));
if (tempprinc->data == 0) {
- free((char *)tempprinc);
+ free(tempprinc);
return ENOMEM;
}
Modified: trunk/src/lib/krb5/krb/parse.c
===================================================================
--- trunk/src/lib/krb5/krb/parse.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/krb/parse.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -148,7 +148,7 @@
}
principal->data = (krb5_data *) malloc(sizeof(krb5_data) * components);
if (principal->data == NULL) {
- free((char *)principal);
+ free(principal);
return ENOMEM;
}
principal->length = components;
@@ -170,7 +170,7 @@
retval = krb5_get_default_realm(context, &default_realm);
if (retval) {
free(principal->data);
- free((char *)principal);
+ free(principal);
return(retval);
}
default_realm_size = strlen(default_realm);
Modified: trunk/src/lib/krb5/rcache/rc_base.c
===================================================================
--- trunk/src/lib/krb5/rcache/rc_base.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/rcache/rc_base.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -15,8 +15,6 @@
#include "rc-int.h"
#include "k5-thread.h"
-#define FREE(x) ((void) free((char *) (x)))
-
struct krb5_rc_typelist {
const krb5_rc_ops *ops;
struct krb5_rc_typelist *next;
@@ -119,13 +117,13 @@
if ((retval = krb5_rc_resolve_type(context, id,
krb5_rc_default_type(context)))) {
- FREE(*id);
+ free(*id);
return retval;
}
if ((retval = krb5_rc_resolve(context, *id,
krb5_rc_default_name(context)))) {
k5_mutex_destroy(&(*id)->lock);
- FREE(*id);
+ free(*id);
return retval;
}
(*id)->magic = KV5M_RCACHE;
@@ -154,19 +152,19 @@
type[residual - string_name] = '\0';
if (!(id = (krb5_rcache) malloc(sizeof(*id)))) {
- FREE(type);
+ free(type);
return KRB5_RC_MALLOC;
}
if ((retval = krb5_rc_resolve_type(context, &id,type))) {
- FREE(type);
- FREE(id);
+ free(type);
+ free(id);
return retval;
}
- FREE(type);
+ free(type);
if ((retval = krb5_rc_resolve(context, id,residual + 1))) {
k5_mutex_destroy(&id->lock);
- FREE(id);
+ free(id);
return retval;
}
id->magic = KV5M_RCACHE;
Modified: trunk/src/lib/krb5/rcache/rc_conv.c
===================================================================
--- trunk/src/lib/krb5/rcache/rc_conv.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/rcache/rc_conv.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -11,8 +11,6 @@
* An implementation for the default replay cache type.
*/
-#define FREE(x) ((void) free((char *) (x)))
-
#include "rc_base.h"
/*
@@ -31,7 +29,7 @@
return retval; /* shouldn't happen */
if ((retval = krb5_unparse_name(context, auth->authenticator->client,
&rep->client))) {
- FREE(rep->server);
+ free(rep->server);
return retval; /* shouldn't happen. */
}
return 0;
Modified: trunk/src/lib/krb5/rcache/rc_io.c
===================================================================
--- trunk/src/lib/krb5/rcache/rc_io.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/lib/krb5/rcache/rc_io.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -40,7 +40,6 @@
#error find some way to use net-byte-order file version numbers.
#endif
-#define FREE(x) ((void) free((char *) (x)))
#define UNIQUE getpid() /* hopefully unique number */
#define GETDIR (dir = getdir(), dirlen = strlen(dir) + sizeof(PATH_SEPARATOR) - 1)
@@ -205,7 +204,7 @@
if (d->fn) {
if (!do_not_unlink)
(void) unlink(d->fn);
- FREE(d->fn);
+ free(d->fn);
d->fn = NULL;
}
if (d->fd != -1) {
@@ -299,7 +298,7 @@
if (d->fn) {
if (!do_not_unlink)
(void) unlink(d->fn);
- FREE(d->fn);
+ free(d->fn);
d->fn = NULL;
}
if (d->fd >= 0)
@@ -470,7 +469,7 @@
krb5_rc_io_close(krb5_context context, krb5_rc_iostuff *d)
{
if (d->fn != NULL) {
- FREE(d->fn);
+ free(d->fn);
d->fn = NULL;
}
if (d->fd != -1) {
Modified: trunk/src/tests/verify/kdb5_verify.c
===================================================================
--- trunk/src/tests/verify/kdb5_verify.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/tests/verify/kdb5_verify.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -303,8 +303,8 @@
}
}
- free((char *)pwd_key.contents);
- free((char *)db_key.contents);
+ free(pwd_key.contents);
+ free(db_key.contents);
if (kdbe.key_data[0].key_data_kvno != 1) {
fprintf(stderr,"\tkvno did not match stored value for %s.\n", princ_name);
Modified: trunk/src/util/ss/invocation.c
===================================================================
--- trunk/src/util/ss/invocation.c 2009-02-02 20:56:18 UTC (rev 21869)
+++ trunk/src/util/ss/invocation.c 2009-02-02 21:13:42 UTC (rev 21870)
@@ -125,6 +125,6 @@
free(t->rqt_tables);
while(t->info_dirs[0] != (char *)NULL)
ss_delete_info_dir(sci_idx, t->info_dirs[0], &ignored_code);
- free((char *)t->info_dirs);
- free((char *)t);
+ free(t->info_dirs);
+ free(t);
}
More information about the cvs-krb5
mailing list