]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - keydb_file.c
cscvs to tla changeset 45
[onak.git] / keydb_file.c
index 4c1a6a384b199018b37b80c9ef12b0f019b31a70..a132ea73c833d679aec4083da3d71ffdbfe1140e 100644 (file)
@@ -88,6 +88,8 @@ int fetch_key(uint64_t keyid, struct openpgp_publickey **publickey,
        if (fd > -1) {
                read_openpgp_stream(file_fetchchar, &fd, &packets);
                parse_keys(packets, publickey);
        if (fd > -1) {
                read_openpgp_stream(file_fetchchar, &fd, &packets);
                parse_keys(packets, publickey);
+               free_packet_list(packets);
+               packets = NULL;
                close(fd);
        }
 
                close(fd);
        }
 
@@ -125,6 +127,8 @@ int store_key(struct openpgp_publickey *publickey, bool intrans, bool update)
                
                write_openpgp_stream(file_putchar, &fd, packets);
                close(fd);
                
                write_openpgp_stream(file_putchar, &fd, packets);
                close(fd);
+               free_packet_list(packets);
+               packets = NULL;
        }
 
        return (fd > -1);
        }
 
        return (fd > -1);