+Wed Feb 25 14:00:32 1998 Ezra Peisach <epeisach@mit.edu>
+
+ * schpw.c (process_chpw_request): Free memory of allocated for
+ local address.
+
+ * ovsec_kadmd.c (do_schpw): Call krb5_kt_close to free memory
+ allocated.
+
Wed Feb 18 15:58:30 1998 Tom Yu <tlyu@mit.edu>
* Makefile.in: Remove trailing slash from thisconfigdir. Fix up
if (connect(s2, (struct sockaddr *) &from, sizeof(from)) < 0) {
krb5_klog_syslog(LOG_ERR, "chpw: Couldn't connect to client: %s",
error_message(errno));
- return;
+ goto cleanup;
}
if (ret = process_chpw_request(context, global_server_handle,
close(s2);
- if (repdata.length == 0)
+ if (repdata.length == 0) {
/* just qreturn. This means something really bad happened */
- return;
+ goto cleanup;
+ }
len = sendto(s1, repdata.data, repdata.length, 0,
(struct sockaddr *) &from, sizeof(from));
krb5_klog_syslog(LOG_ERR, "chpw: Error sending reply: %s",
error_message(errno));
- return;
+ goto cleanup;
}
krb5_xfree(repdata.data);
+cleanup:
+ krb5_kt_close(context, kt);
+
return;
}
char *ptr;
int plen, vno;
krb5_address local_kaddr, remote_kaddr;
+ int allocated_mem = 0;
krb5_data ap_req, ap_rep;
krb5_auth_context auth_context;
krb5_principal changepw;
local_kaddr.length = addrs[0]->length;
local_kaddr.contents = malloc(addrs[0]->length);
memcpy(local_kaddr.contents, addrs[0]->contents, addrs[0]->length);
+ allocated_mem++;
krb5_free_addresses(context, addrs);
}
krb5_xfree(clear.data);
if (cipher.length)
krb5_xfree(cipher.data);
+ if (allocated_mem)
+ krb5_xfree(local_kaddr.contents);
return(ret);
}