diff --git a/src/util/argv.c b/src/util/argv.c index 6a0b8c1c92..5fcdb9fce3 100644 --- a/src/util/argv.c +++ b/src/util/argv.c @@ -292,18 +292,18 @@ int ompi_argv_delete(int *argc, char ***argv, int start, int num_to_delete) /* Free all items that are being deleted */ for (i = start; i < count && i < start + num_to_delete; ++i) { - free(*argv[i]); + free((*argv)[i]); } /* Copy the suffix over the deleted items */ for (i = start; i < start + suffix_count; ++i) { - *argv[i] = *argv[i + num_to_delete]; + (*argv)[i] = (*argv)[i + num_to_delete]; } /* Add the trailing NULL */ - *argv[i] = NULL; + (*argv)[i] = NULL; /* adjust the argv array */ tmp = realloc(*argv, sizeof(char**) * (i + 1));