wmbiff: fixed leaks.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:
parent
e672c84d1c
commit
de97a44cb4
|
@ -200,6 +200,7 @@ FILE *imap_open(Pop3 *pc)
|
|||
mailboxes more often while remote things are
|
||||
unavailable or disconnected. */
|
||||
}
|
||||
free(connection_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -463,6 +464,7 @@ void imap_cacheHeaders( /*@notnull@ */ Pop3 *pc)
|
|||
pc->headerCache = m;
|
||||
pc->headerCache->in_use = 0; /* initialize that it isn't locked */
|
||||
} else {
|
||||
free(m);
|
||||
IMAP_DM(pc, DEBUG_ERROR, "error fetching: %s", hdrbuf);
|
||||
}
|
||||
if (!fetch_command_done) {
|
||||
|
|
|
@ -213,6 +213,7 @@ char *passwordFor(const char *username, const char *servername, Pop3 *pc,
|
|||
{
|
||||
|
||||
password_binding *p;
|
||||
int p_allocked = 0;
|
||||
|
||||
assert(username != NULL);
|
||||
assert(username[0] != '\0');
|
||||
|
@ -241,6 +242,7 @@ char *passwordFor(const char *username, const char *servername, Pop3 *pc,
|
|||
}
|
||||
} else {
|
||||
p = malloc(sizeof *p);
|
||||
p_allocked = 1;
|
||||
}
|
||||
|
||||
/* else, try to get it. */
|
||||
|
@ -282,6 +284,9 @@ char *passwordFor(const char *username, const char *servername, Pop3 *pc,
|
|||
return (retval);
|
||||
}
|
||||
|
||||
if (p_allocked) {
|
||||
free(p);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ main(int argc __attribute__ ((unused)), char **argv
|
|||
memset(scs.unprocessed, 0, BUF_SIZE);
|
||||
printf("%d\n", tlscomm_expect(&scs, "prefix", buf, 255));
|
||||
}
|
||||
free(scs.name);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
|
@ -386,9 +386,9 @@ static int tls_compare_certificates(const gnutls_datum_t * peercert)
|
|||
|
||||
fd1 = fopen(certificate_filename, "r");
|
||||
if (fd1 == NULL) {
|
||||
free(b64_data_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
b64_data.size = fread(b64_data.data, 1, b64_data.size, fd1);
|
||||
fclose(fd1);
|
||||
|
||||
|
|
|
@ -119,8 +119,8 @@ void parse_rcfile(const char *filename, rckeys * keys)
|
|||
if (fp) {
|
||||
while (fgets(temp, 128, fp)) {
|
||||
key = 0;
|
||||
q = strdup(temp);
|
||||
q = strtok(q, tokens);
|
||||
char *t = strdup(temp);
|
||||
q = strtok(t, tokens);
|
||||
while (key >= 0 && keys[key].label) {
|
||||
if ((!strcmp(q, keys[key].label))) {
|
||||
p = strstr(temp, keys[key].label);
|
||||
|
@ -134,7 +134,7 @@ void parse_rcfile(const char *filename, rckeys * keys)
|
|||
} else
|
||||
key++;
|
||||
}
|
||||
free(q);
|
||||
free(t);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue