Skip to content

Commit c41a221

Browse files
authored
Merge pull request #1020 from nliviu/patch-2
Fix ASAN build for examples/cookie_auth
2 parents 900c052 + 12339bb commit c41a221

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/cookie_auth/cookie_auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ static int check_pass(const char *user, const char *pass) {
5858
* or NULL if not found.
5959
*/
6060
static struct session *get_session(struct http_message *hm) {
61-
struct mg_str *cookie_header = mg_get_http_header(hm, "cookie");
62-
if (cookie_header == NULL) goto clean;
6361
char ssid_buf[21];
6462
char *ssid = ssid_buf;
6563
struct session *ret = NULL;
64+
struct mg_str *cookie_header = mg_get_http_header(hm, "cookie");
65+
if (cookie_header == NULL) goto clean;
6666
if (!mg_http_parse_header2(cookie_header, SESSION_COOKIE_NAME, &ssid,
6767
sizeof(ssid_buf))) {
6868
goto clean;

0 commit comments

Comments
 (0)