Skip to content

Commit

Permalink
Merge pull request #130 from underhood/missing_va_end
Browse files Browse the repository at this point in the history
missing va_end in error case
  • Loading branch information
LiamBindle authored Mar 29, 2021
2 parents 915bdf3 + 9d98e1a commit 9699785
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 9699785

Please sign in to comment.