diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-06-09 22:55:30 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-06-09 22:55:30 -0400 | 
| commit | c44d563ea5bd5e1fc3c5bebb4aaaa14ff08ecfde (patch) | |
| tree | 7d2ae866a54f4a69ac87dacacad0b4af9db15447 | |
| parent | e9b4f5c8b6f109e3cd7bcb93ecd68ad2a94b9568 (diff) | |
| download | ohmycal-c44d563ea5bd5e1fc3c5bebb4aaaa14ff08ecfde.tar.gz | |
Fix filename assignment in is_url mode
| -rw-r--r-- | src/strlist.c | 7 | 
1 files changed, 2 insertions, 5 deletions
diff --git a/src/strlist.c b/src/strlist.c index bd88c46..0cad270 100644 --- a/src/strlist.c +++ b/src/strlist.c @@ -91,13 +91,12 @@ int strlist_append_file(struct StrList *pStrList, char *_path, ReaderFn *readerF              goto fatal;          }          close(fd); -        filename = tempfile; +        filename = strdup(tempfile);          long http_code = download(path, filename, NULL);          if (HTTP_ERROR(http_code)) {              retval = -1;              goto fatal;          } -      } else {          filename = expandpath(path);          if (filename == NULL) { @@ -122,9 +121,7 @@ int strlist_append_file(struct StrList *pStrList, char *_path, ReaderFn *readerF      guard_free(data);  fatal: -    if (!is_url && filename != NULL) { -        guard_free(filename); -    } +    guard_free(filename);      if (path != NULL) {          guard_free(path);      }  | 
