Skip to content

Commit ba4d1c7

Browse files
peffgitster
authored andcommitted
argv-array: fix bogus cast when freeing array
Since the array struct stores a "const char **" argv member (for compatibility with most of our argv-taking functions), we have to cast away the const-ness when freeing its elements. However, we used the wrong type when doing so. It doesn't make a difference since free() take a void pointer anyway, but it can be slightly confusing to a reader. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe4a0a2 commit ba4d1c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

argv-array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void argv_array_clear(struct argv_array *array)
6363
if (array->argv != empty_argv) {
6464
int i;
6565
for (i = 0; i < array->argc; i++)
66-
free((char **)array->argv[i]);
66+
free((char *)array->argv[i]);
6767
free(array->argv);
6868
}
6969
argv_array_init(array);

0 commit comments

Comments
 (0)