Skip to content

Commit effd95c

Browse files
committed
CDRIVER-5504 Use pointer-based iteration when traversing array elements (#1552)
1 parent 373e6ba commit effd95c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libbson/src/bson/bson-string.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,11 @@ bson_strndup (const char *str, /* IN */
473473
void
474474
bson_strfreev (char **str) /* IN */
475475
{
476-
int i;
477-
478476
if (str) {
479-
for (i = 0; str[i]; i++)
480-
bson_free (str[i]);
477+
for (char **ptr = str; *ptr != NULL; ++ptr) {
478+
bson_free (*ptr);
479+
}
480+
481481
bson_free (str);
482482
}
483483
}

0 commit comments

Comments
 (0)