Skip to content

Commit

Permalink
Fix for bug #424692
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Craggs committed Jan 21, 2014
1 parent 200c93b commit 3592632
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rsmb/src/MQTTSProtocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
* Contributors:
* Ian Craggs, Nicholas O'Leary - initial API and implementation and/or initial documentation
* Ian Craggs - fix for bug #424692
*******************************************************************************/

#if defined(MQTTS)
Expand Down Expand Up @@ -622,8 +623,11 @@ int MQTTSProtocol_handlePublishes(void* pack, int sock, char* clientAddr, Client
{
/* copy the topic name as it will be freed later */
char* name = MQTTSProtocol_getRegisteredTopicName(client, pub->topicId);
topicName = malloc(strlen(name) + 1);
strcpy(topicName, name);
if (name)
{
topicName = malloc(strlen(name) + 1);
strcpy(topicName, name);
}
}
else if (pub->shortTopic != NULL)
{
Expand Down

0 comments on commit 3592632

Please sign in to comment.