зеркало из https://github.com/microsoft/git.git
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
fe4a0a2888
Коммит
ba4d1c7b16
|
@ -63,7 +63,7 @@ void argv_array_clear(struct argv_array *array)
|
||||||
if (array->argv != empty_argv) {
|
if (array->argv != empty_argv) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < array->argc; i++)
|
for (i = 0; i < array->argc; i++)
|
||||||
free((char **)array->argv[i]);
|
free((char *)array->argv[i]);
|
||||||
free(array->argv);
|
free(array->argv);
|
||||||
}
|
}
|
||||||
argv_array_init(array);
|
argv_array_init(array);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче