Commit ba4d1c7b authored by Jeff King's avatar Jeff King Committed by Junio C Hamano

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: 's avatarJeff King <peff@peff.net>
Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
parent fe4a0a28
......@@ -63,7 +63,7 @@ void argv_array_clear(struct argv_array *array)
if (array->argv != empty_argv) {
int i;
for (i = 0; i < array->argc; i++)
free((char **)array->argv[i]);
free((char *)array->argv[i]);
free(array->argv);
}
argv_array_init(array);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment