Skip to content

Commit 7a5be8a

Browse files
committed
Remove unused function MQTTPacket_free_packet
1 parent 67592da commit 7a5be8a

2 files changed

Lines changed: 1 addition & 22 deletions

File tree

src/MQTTPacket.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -967,25 +967,6 @@ int MQTTPacket_send_publish(Publish* pack, int dup, int qos, int retained, netwo
967967
}
968968

969969

970-
/**
971-
* Free allocated storage for a various packet tyoes
972-
* @param pack pointer to the suback packet structure
973-
*/
974-
void MQTTPacket_free_packet(MQTTPacket* pack)
975-
{
976-
FUNC_ENTRY;
977-
if (pack->header.bits.type == PUBLISH)
978-
MQTTPacket_freePublish((Publish*)pack);
979-
/*else if (pack->header.type == SUBSCRIBE)
980-
MQTTPacket_freeSubscribe((Subscribe*)pack, 1);
981-
else if (pack->header.type == UNSUBSCRIBE)
982-
MQTTPacket_freeUnsubscribe((Unsubscribe*)pack);*/
983-
else
984-
free(pack);
985-
FUNC_EXIT;
986-
}
987-
988-
989970
/**
990971
* Writes an integer as 4 bytes to an output buffer.
991972
* @param pptr pointer to the output buffer - incremented by the number of bytes used & returned

src/MQTTPacket.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2024 IBM Corp.
2+
* Copyright (c) 2009, 2026 IBM Corp., Ian Craggs
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v2.0
@@ -258,8 +258,6 @@ int MQTTPacket_send_pubrec(int MQTTVersion, int msgid, networkHandles* net, cons
258258
int MQTTPacket_send_pubrel(int MQTTVersion, int msgid, int dup, networkHandles* net, const char* clientID);
259259
int MQTTPacket_send_pubcomp(int MQTTVersion, int msgid, networkHandles* net, const char* clientID);
260260

261-
void MQTTPacket_free_packet(MQTTPacket* pack);
262-
263261
void writeInt4(char** pptr, unsigned int anInt);
264262
unsigned int readInt4(char** pptr);
265263
void writeMQTTLenString(char** pptr, MQTTLenString lenstring);

0 commit comments

Comments
 (0)