mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
Merge pull request #3573 from cesanta/dash-valgrind
dash: free user structures
This commit is contained in:
3 files changed
+7
No files matched your search
@@ -468,6 +468,7 @@ static struct mg_dash_user *mg_dash_authenticate(struct mg_http_message *hm,
|
|||||||
MG_DEBUG(("Deleting expired auth %s/%d %llu %u", u->name, u->level,
|
MG_DEBUG(("Deleting expired auth %s/%d %llu %u", u->name, u->level,
|
||||||
u->expire, mg_millis() - u->expire));
|
u->expire, mg_millis() - u->expire));
|
||||||
LIST_DELETE(struct mg_dash_user, &s_users, u);
|
LIST_DELETE(struct mg_dash_user, &s_users, u);
|
||||||
|
mg_free(u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -347,6 +347,7 @@ static struct mg_dash_user *mg_dash_authenticate(struct mg_http_message *hm,
|
|||||||
MG_DEBUG(("Deleting expired auth %s/%d %llu %u", u->name, u->level,
|
MG_DEBUG(("Deleting expired auth %s/%d %llu %u", u->name, u->level,
|
||||||
u->expire, mg_millis() - u->expire));
|
u->expire, mg_millis() - u->expire));
|
||||||
LIST_DELETE(struct mg_dash_user, &s_users, u);
|
LIST_DELETE(struct mg_dash_user, &s_users, u);
|
||||||
|
mg_free(u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4305,6 +4305,7 @@ static void test_dash(void) {
|
|||||||
char marker = 0;
|
char marker = 0;
|
||||||
|
|
||||||
memset(&dash, 0, sizeof(dash));
|
memset(&dash, 0, sizeof(dash));
|
||||||
|
dash.session_auto_expiration_seconds = 1;
|
||||||
|
|
||||||
MG_DASH_ADD_FIELD_SET(&dash, &set1);
|
MG_DASH_ADD_FIELD_SET(&dash, &set1);
|
||||||
ASSERT(dash.sets == &set1);
|
ASSERT(dash.sets == &set1);
|
||||||
@@ -4461,6 +4462,10 @@ static void test_dash(void) {
|
|||||||
"Authorization: Basic YWRtaW46YWRtaW4=\n\n") == 200);
|
"Authorization: Basic YWRtaW46YWRtaW4=\n\n") == 200);
|
||||||
ASSERT(cmpbody(buf, set1_expected4) == 0);
|
ASSERT(cmpbody(buf, set1_expected4) == 0);
|
||||||
|
|
||||||
|
mg_delayms(1100);
|
||||||
|
ASSERT(fetch(&mgr, buf, url, "GET /api/hi HTTP/1.0\n\n") == 200);
|
||||||
|
ASSERT(cmpbody(buf, "hi\n") == 0);
|
||||||
|
|
||||||
mg_mgr_free(&mgr);
|
mg_mgr_free(&mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user