#include "keystructs.h"
#include "ll.h"
-#include "log.h"
#include "mem.h"
+#include "stats.h"
/**
* packet_dup - duplicate an OpenPGP packet.
{
struct openpgp_packet *newpacket = NULL;
- log_assert(packet != NULL);
+ if (packet == NULL)
+ return NULL;
newpacket = malloc(sizeof (struct openpgp_packet));
if (newpacket != NULL) {
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));
* 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;