Skip to content

Commit

Permalink
CDRIVER-5504 Use pointer-based iteration when traversing array elemen…
Browse files Browse the repository at this point in the history
…ts (#1552)
  • Loading branch information
eramongodb committed Mar 8, 2024
1 parent 373e6ba commit effd95c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libbson/src/bson/bson-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,11 @@ bson_strndup (const char *str, /* IN */
void
bson_strfreev (char **str) /* IN */
{
int i;

if (str) {
for (i = 0; str[i]; i++)
bson_free (str[i]);
for (char **ptr = str; *ptr != NULL; ++ptr) {
bson_free (*ptr);
}

bson_free (str);
}
}
Expand Down

0 comments on commit effd95c

Please sign in to comment.