Skip to content

Commit

Permalink
fix crash on save
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed May 2, 2023
1 parent 646bfc0 commit 9e926ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gplaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ struct Selector {
#endif
char type, *repr, *rawurl;
CURLU *cu;
const Protocol *proto;
};

struct URL {
Expand Down Expand Up @@ -1197,9 +1196,9 @@ static void download_to_file(const Selector *sel, URL *url, const char *def) {
}
if ((fp = fopen(filename, "wb")) == NULL) error(0, "cannot create file `%s`: %s", filename, strerror(errno));
else {
if ((c = sel->proto->download(sel, url, &mime, &parser, 1)) != NULL) {
if ((c = url->proto->download(sel, url, &mime, &parser, 1)) != NULL) {
ret = save_body(url, c, fp);
sel->proto->close(c);
url->proto->close(c);
}

fclose(fp);
Expand Down

0 comments on commit 9e926ba

Please sign in to comment.