summaryrefslogtreecommitdiffstats
path: root/src/appl/gssftp/ftp
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2003-06-25 21:10:48 +0000
committerTom Yu <tlyu@mit.edu>2003-06-25 21:10:48 +0000
commit2c2f893544ba614e9bd0dd99e0f322555ea281a9 (patch)
treedc9b34d55727a6e97058557ce4d65bb2251aa4f8 /src/appl/gssftp/ftp
parentb3013084520501572335d9a6f7bfdd956c5d6236 (diff)
downloadkrb5-2c2f893544ba614e9bd0dd99e0f322555ea281a9.tar.gz
krb5-2c2f893544ba614e9bd0dd99e0f322555ea281a9.tar.xz
krb5-2c2f893544ba614e9bd0dd99e0f322555ea281a9.zip
clean up ftp client gss memory management
* ftp.c (do_auth): Call gss_release_buffer() on send_tok immediately after sending it. Call gss_release_name() on target_name at outer_loop instead of inside the loop. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15651 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/gssftp/ftp')
-rw-r--r--src/appl/gssftp/ftp/ChangeLog6
-rw-r--r--src/appl/gssftp/ftp/ftp.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog
index 445734fb26..600eb26882 100644
--- a/src/appl/gssftp/ftp/ChangeLog
+++ b/src/appl/gssftp/ftp/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-25 Tom Yu <tlyu@mit.edu>
+
+ * ftp.c (do_auth): Call gss_release_buffer() on send_tok
+ immediately after sending it. Call gss_release_name() on
+ target_name at outer_loop instead of inside the loop.
+
2003-06-16 Ken Raeburn <raeburn@mit.edu>
* ftp.c (recvrequest): Add new argument indicating whether "-" and
diff --git a/src/appl/gssftp/ftp/ftp.c b/src/appl/gssftp/ftp/ftp.c
index 155f857925..769a3cd177 100644
--- a/src/appl/gssftp/ftp/ftp.c
+++ b/src/appl/gssftp/ftp/ftp.c
@@ -1983,7 +1983,7 @@ int do_auth()
#ifdef GSSAPI
if (command("AUTH %s", "GSSAPI") == CONTINUE) {
- OM_uint32 maj_stat, min_stat;
+ OM_uint32 maj_stat, min_stat, dummy_stat;
gss_name_t target_name;
gss_buffer_desc send_tok, recv_tok, *token_ptr;
char stbuf[FTP_BUFSIZ];
@@ -2048,7 +2048,6 @@ int do_auth()
if (maj_stat!=GSS_S_COMPLETE && maj_stat!=GSS_S_CONTINUE_NEEDED){
if (trial == n_gss_trials-1)
user_gss_error(maj_stat, min_stat, "initializing context");
- (void) gss_release_name(&min_stat, &target_name);
/* could just be that we missed on the service name */
goto outer_loop;
}
@@ -2059,6 +2058,7 @@ int do_auth()
oldverbose = verbose;
verbose = (trial == n_gss_trials-1)?0:-1;
kerror = radix_encode(send_tok.value, out_buf, &len, 0);
+ gss_release_buffer(&dummy_stat, &send_tok);
if (kerror) {
fprintf(stderr, "Base 64 encoding failed: %s\n",
radix_error(kerror));
@@ -2104,12 +2104,11 @@ int do_auth()
/* get out of loop clean */
gss_complete_loop:
trial = n_gss_trials-1;
- gss_release_buffer(&min_stat, &send_tok);
- gss_release_name(&min_stat, &target_name);
goto outer_loop;
}
} while (maj_stat == GSS_S_CONTINUE_NEEDED);
outer_loop:
+ gss_release_name(&dummy_stat, &target_name);
if (maj_stat == GSS_S_COMPLETE)
break;
}