X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=mem.c;h=2b45158028857d2c57b71f947110d7a621980e21;hb=e0dd4d10f385cd19da389ec66622eea8aa66ae59;hp=2f13cf5fffc71fb07d92d4b74c7b0c12760324d3;hpb=f81196236e05340a025e94f65830793c3d60401d;p=onak.git diff --git a/mem.c b/mem.c index 2f13cf5..2b45158 100644 --- a/mem.c +++ b/mem.c @@ -23,7 +23,6 @@ #include "keystructs.h" #include "ll.h" -#include "log.h" #include "mem.h" /** @@ -38,7 +37,8 @@ struct openpgp_packet *packet_dup(struct openpgp_packet *packet) { struct openpgp_packet *newpacket = NULL; - log_assert(packet != NULL); + if (packet == NULL) + return NULL; newpacket = malloc(sizeof (struct openpgp_packet)); if (newpacket != NULL) { @@ -70,9 +70,6 @@ void packet_list_add(struct openpgp_packet_list **list, struct openpgp_packet_list **list_end, struct openpgp_packet_list *packet_list) { - log_assert(list != NULL); - log_assert(list_end != NULL); - for (; packet_list != NULL; packet_list = packet_list->next) { ADD_PACKET_TO_LIST((*list_end), packet_dup(packet_list->packet)); @@ -92,8 +89,6 @@ void packet_list_add(struct openpgp_packet_list **list, * including the data part. */ void free_packet(struct openpgp_packet *packet) { - log_assert(packet != NULL); - if (packet->data != NULL) { free(packet->data); packet->data = NULL;