Skip to content

Commit

Permalink
missing va_end in error case
Browse files Browse the repository at this point in the history
  • Loading branch information
underhood committed Mar 24, 2021
1 parent e44bef9 commit 9d98e1a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,7 @@ ssize_t mqtt_pack_subscribe_request(uint8_t *buf, size_t bufsz, unsigned int pac

++num_subs;
if (num_subs >= MQTT_SUBSCRIBE_REQUEST_MAX_NUM_TOPICS) {
va_end(args);
return MQTT_ERROR_SUBSCRIBE_TOO_MANY_TOPICS;
}
}
Expand Down Expand Up @@ -1560,6 +1561,7 @@ ssize_t mqtt_pack_unsubscribe_request(uint8_t *buf, size_t bufsz, unsigned int p

++num_subs;
if (num_subs >= MQTT_UNSUBSCRIBE_REQUEST_MAX_NUM_TOPICS) {
va_end(args);
return MQTT_ERROR_UNSUBSCRIBE_TOO_MANY_TOPICS;
}
}
Expand Down

0 comments on commit 9d98e1a

Please sign in to comment.