We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 164f21a commit 2ef9c75Copy full SHA for 2ef9c75
src/mdtest.c
@@ -206,13 +206,13 @@ void parse_dirpath(char *dirpath_arg) {
206
}
207
tmp++;
208
209
+ // prevent changes to the original dirpath_arg
210
+ dirpath_arg = strdup(dirpath_arg);
211
filenames = (char **)malloc(path_count * sizeof(char **));
- if (filenames == NULL) {
212
+ if (filenames == NULL || dirpath_arg == NULL) {
213
FAIL("out of memory");
214
215
- // prevent changes to the original dirpath_arg
- dirpath_arg = strdup(dirpath_arg);
216
token = strtok(dirpath_arg, delimiter_string);
217
while (token != NULL) {
218
filenames[i] = token;
0 commit comments