Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cookies: fix: Don't allow a NULL to be passed to cookie_to_struct. Ca…

…lling func must supply its own allocated struct
  • Loading branch information...
commit aa31aceb6c6053a969b8e16d08f9fbffab87393c 1 parent dd8e5c8
@falconindy authored
Showing with 0 additions and 8 deletions.
  1. +0 −8 cookies.c
View
8 cookies.c
@@ -47,14 +47,6 @@ long cookie_expire_time(const char *cookie_file,
}
struct cookie_t *cookie_to_struct(char *co, struct cookie_t **cookie) {
- if (*cookie == NULL) {
- *cookie = calloc(1, sizeof **cookie);
- if (*cookie == NULL) {
- fprintf(stderr, "Error allocating %zd bytes.\n", sizeof **cookie);
- return NULL;
- }
- }
-
(*cookie)->domain = strsep(&co, "\t");
(*cookie)->secure = STREQ(strsep(&co, "\t"), "TRUE") ? 1 : 0;
(*cookie)->path = strsep(&co, "\t");
Please sign in to comment.
Something went wrong with that request. Please try again.