]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - mem.c
Ensure DB4 backend dbconns memory is initialised to zero
[onak.git] / mem.c
diff --git a/mem.c b/mem.c
index 83ffa55375e5713477d4d68dacadf59a6d5e73e0..47f296744d3e1c25e93c8cafd5aeaed913d03297 100644 (file)
--- a/mem.c
+++ b/mem.c
@@ -6,13 +6,13 @@
  * Copyright 2002 Project Purple
  */
 
  * Copyright 2002 Project Purple
  */
 
-#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "keystructs.h"
 #include "ll.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "keystructs.h"
 #include "ll.h"
+#include "log.h"
 #include "mem.h"
 
 /**
 #include "mem.h"
 
 /**
@@ -27,7 +27,7 @@ struct openpgp_packet *packet_dup(struct openpgp_packet *packet)
 {
        struct openpgp_packet *newpacket = NULL;
 
 {
        struct openpgp_packet *newpacket = NULL;
 
-       assert(packet != NULL);
+       log_assert(packet != NULL);
 
        newpacket = malloc(sizeof (struct openpgp_packet));
        if (newpacket != NULL) {
 
        newpacket = malloc(sizeof (struct openpgp_packet));
        if (newpacket != NULL) {
@@ -59,8 +59,8 @@ void packet_list_add(struct openpgp_packet_list **list,
                struct openpgp_packet_list **list_end,
                struct openpgp_packet_list *packet_list)
 {
                struct openpgp_packet_list **list_end,
                struct openpgp_packet_list *packet_list)
 {
-       assert(list != NULL);
-       assert(list_end != NULL);
+       log_assert(list != NULL);
+       log_assert(list_end != NULL);
 
        for (; packet_list != NULL; packet_list = packet_list->next) {
                ADD_PACKET_TO_LIST((*list_end),
 
        for (; packet_list != NULL; packet_list = packet_list->next) {
                ADD_PACKET_TO_LIST((*list_end),
@@ -81,7 +81,7 @@ void packet_list_add(struct openpgp_packet_list **list,
  *     including the data part.
  */
 void free_packet(struct openpgp_packet *packet) {
  *     including the data part.
  */
 void free_packet(struct openpgp_packet *packet) {
-       assert(packet != NULL);
+       log_assert(packet != NULL);
 
        if (packet->data != NULL) {
                free(packet->data);
 
        if (packet->data != NULL) {
                free(packet->data);
@@ -100,8 +100,6 @@ void free_packet(struct openpgp_packet *packet) {
 void free_packet_list(struct openpgp_packet_list *packet_list) {
        struct openpgp_packet_list *nextpacket = NULL;
 
 void free_packet_list(struct openpgp_packet_list *packet_list) {
        struct openpgp_packet_list *nextpacket = NULL;
 
-       assert(packet_list != NULL);
-
        while (packet_list != NULL) {
                nextpacket = packet_list->next;
                if (packet_list->packet != NULL) {
        while (packet_list != NULL) {
                nextpacket = packet_list->next;
                if (packet_list->packet != NULL) {
@@ -123,8 +121,6 @@ void free_signedpacket_list(
                struct openpgp_signedpacket_list *signedpacket_list) {
        struct openpgp_signedpacket_list *nextpacket = NULL;
 
                struct openpgp_signedpacket_list *signedpacket_list) {
        struct openpgp_signedpacket_list *nextpacket = NULL;
 
-       assert(signedpacket_list != NULL);
-
        while (signedpacket_list != NULL) {
                nextpacket = signedpacket_list->next;
                if (signedpacket_list->packet != NULL) {
        while (signedpacket_list != NULL) {
                nextpacket = signedpacket_list->next;
                if (signedpacket_list->packet != NULL) {
@@ -148,17 +144,15 @@ void free_signedpacket_list(
 void free_publickey(struct openpgp_publickey *key) {
        struct openpgp_publickey *nextkey = NULL;
 
 void free_publickey(struct openpgp_publickey *key) {
        struct openpgp_publickey *nextkey = NULL;
 
-       assert(key != NULL);
-
        while (key != NULL) {
                nextkey = key->next;
                if (key->publickey != NULL) {
                        free_packet(key->publickey);
                        key->publickey = NULL;
                }
        while (key != NULL) {
                nextkey = key->next;
                if (key->publickey != NULL) {
                        free_packet(key->publickey);
                        key->publickey = NULL;
                }
-               if (key->revocations != NULL) {
-                       free_packet_list(key->revocations);
-                       key->revocations = NULL;
+               if (key->sigs != NULL) {
+                       free_packet_list(key->sigs);
+                       key->sigs = NULL;
                }
                if (key->uids != NULL) {
                        free_signedpacket_list(key->uids);
                }
                if (key->uids != NULL) {
                        free_signedpacket_list(key->uids);