Don't process publish command if restore fails #1388

This commit is contained in:
Ian Craggs 2024-12-20 12:31:52 +00:00
parent 25bca9dd55
commit 597cd06e26
1 changed files with 5 additions and 1 deletions

View File

@ -1295,11 +1295,15 @@ static int MQTTAsync_processCommand(void)
command = MQTTAsync_restoreCommand(buffer, buflen, MQTTVersion, command);
}
else
{
Log(LOG_ERROR, -1, "Error restoring command: rc %d from pget\n", rc);
command = NULL;
}
if (buffer)
free(buffer);
}
MQTTAsync_unpersistCommand(command);
if (command)
MQTTAsync_unpersistCommand(command);
}
#endif
}