aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2020-04-21 02:35:22 +1000
committeronefang2020-04-21 02:35:22 +1000
commitbaa0dc8c594b7cfe007cfb129bce81104c3b8895 (patch)
treeeef371d1a52ca4d3a3b4f0cdf40e16f14a43ee4e
parentUse the new button titles. (diff)
downloadopensim-SC_OLD-baa0dc8c594b7cfe007cfb129bce81104c3b8895.zip
opensim-SC_OLD-baa0dc8c594b7cfe007cfb129bce81104c3b8895.tar.gz
opensim-SC_OLD-baa0dc8c594b7cfe007cfb129bce81104c3b8895.tar.bz2
opensim-SC_OLD-baa0dc8c594b7cfe007cfb129bce81104c3b8895.tar.xz
Fix some leaks.
-rw-r--r--src/sledjchisl/sledjchisl.c43
1 files changed, 34 insertions, 9 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c
index 05704e9..b05aaa0 100644
--- a/src/sledjchisl/sledjchisl.c
+++ b/src/sledjchisl/sledjchisl.c
@@ -2637,7 +2637,8 @@ void unfragize(qlist_t *fragments, reqData *Rd, boolean fre)
2637 E("NULL fragment!"); 2637 E("NULL fragment!");
2638 continue; 2638 continue;
2639 } 2639 }
2640 HTMLfill(Rd, frg->type, frg->text, frg->length); 2640 if (NULL != Rd)
2641 HTMLfill(Rd, frg->type, frg->text, frg->length);
2641 if (fre) 2642 if (fre)
2642 free(frg->text); 2643 free(frg->text);
2643 } 2644 }
@@ -4305,23 +4306,29 @@ static void accountLoginWeb(reqData *Rd, inputForm *oF, inputValue *oV)
4305 4306
4306static void accountViewWeb(reqData *Rd, inputForm *oF, inputValue *oV) 4307static void accountViewWeb(reqData *Rd, inputForm *oF, inputValue *oV)
4307{ 4308{
4309 char *name = getStrH(Rd->stuff, "name"),
4310 *email = displayPrep(getStrH(Rd->stuff, "email")),
4311 *voucher = displayPrep(getStrH(Rd->database, "Lua.voucher")),
4312 *about = displayPrep(getStrH(Rd->database, "Lua.aboutMe"));
4308 time_t crtd = atol(getStrH(Rd->database, "UserAccounts.Created")); 4313 time_t crtd = atol(getStrH(Rd->database, "UserAccounts.Created"));
4309 4314
4310 accountWebHeaders(Rd, oF, getStrH(Rd->stuff, "name")); 4315 accountWebHeaders(Rd, oF, name);
4311 accountWebFields(Rd, oF, oV); 4316 accountWebFields(Rd, oF, oV);
4312// TODO - still need to encode < > as &lt; u&gt; for email, voucher, and about. 4317// TODO - still need to encode < > as &lt; u&gt; for email, voucher, and about.
4313// TODO - dammit, qurl_decode returns the string length, and decodes the string in place. 4318// TODO - dammit, qurl_decode returns the string length, and decodes the string in place.
4314 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Title / level :</b></span></font> %s / %d</p>", getLevel(Rd), Rd->shs.level); 4319 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Title / level :</b></span></font> %s / %d</p>", getLevel(Rd), Rd->shs.level);
4315 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Date of birth :</b></span></font> %s</p>", getStrH(Rd->database, "Lua.DoB")); 4320 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Date of birth :</b></span></font> %s</p>", getStrH(Rd->database, "Lua.DoB"));
4316 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Created :</b></span></font> %s</p>", ctime(&crtd)); 4321 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Created :</b></span></font> %s</p>", ctime(&crtd));
4317 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Email :</b></span></font> %s</p>", displayPrep(getStrH(Rd->stuff, "email"))); 4322 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Email :</b></span></font> %s</p>", email);
4318 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>UUID :</b></span></font> %s</p>", Rd->shs.UUID); 4323 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>UUID :</b></span></font> %s</p>", Rd->shs.UUID);
4319 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Voucher :</b></span></font> %s</p>", displayPrep(getStrH(Rd->database, "Lua.voucher"))); 4324 Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Voucher :</b></span></font> %s</p>", voucher);
4320// Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>About :</b></span></font> </p>" 4325// Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>About :</b></span></font> </p>"
4321// "<textarea readonly >%s</textarea>", qurl_decode(getStrH(Rd->database, "Lua.aboutMe"))); 4326// "<textarea readonly >%s</textarea>", qurl_decode(getStrH(Rd->database, "Lua.aboutMe")));
4322 HTMLtextArea(Rd->reply, "aboutMe", "About", 7, 50, 4, 16384, "", "off", "true", "soft", displayPrep(getStrH(Rd->database, "Lua.aboutMe")), FALSE, TRUE); 4327 HTMLtextArea(Rd->reply, "aboutMe", "About", 7, 50, 4, 16384, "", "off", "true", "soft", about, FALSE, TRUE);
4323 accountWebSubs(Rd, oF); 4328 accountWebSubs(Rd, oF);
4324 accountWebFooter(Rd, oF); 4329 accountWebFooter(Rd, oF);
4330 free(about); free(voucher); free(email);
4331
4325} 4332}
4326 4333
4327static void accountEditWeb(reqData *Rd, inputForm *oF, inputValue *oV) 4334static void accountEditWeb(reqData *Rd, inputForm *oF, inputValue *oV)
@@ -5324,7 +5331,11 @@ static void cleanup(void)
5324 accountPages->lock(accountPages); 5331 accountPages->lock(accountPages);
5325 while(accountPages->getnext(accountPages, &obj, true) == true) 5332 while(accountPages->getnext(accountPages, &obj, true) == true)
5326 { 5333 {
5327// d("%s = %s", obj.name, (char *) obj.data); 5334 inputForm *f = (inputForm *) obj.data;
5335
5336//d("%s = %s", obj.name, (char *) obj.data);
5337 f->subs->free(f->subs);
5338 f->fields->free(f->fields);
5328 } 5339 }
5329 accountPages->unlock(accountPages); 5340 accountPages->unlock(accountPages);
5330 accountPages->free(accountPages); 5341 accountPages->free(accountPages);
@@ -5333,8 +5344,22 @@ static void cleanup(void)
5333// if (fieldValidFuncs) fieldValidFuncs->free(fieldValidFuncs); 5344// if (fieldValidFuncs) fieldValidFuncs->free(fieldValidFuncs);
5334// if (buildPages) buildPages->free(buildPages); 5345// if (buildPages) buildPages->free(buildPages);
5335 if (dynPages) dynPages->free(dynPages); 5346 if (dynPages) dynPages->free(dynPages);
5336 if (HTMLfileCache) HTMLfileCache->free(HTMLfileCache); 5347 if (HTMLfileCache)
5337 if (HTMLfileCache) mimeTypes->free(mimeTypes); 5348 {
5349 qhashtbl_obj_t obj;
5350
5351 memset((void*)&obj, 0, sizeof(obj));
5352 HTMLfileCache->lock(HTMLfileCache);
5353 while(HTMLfileCache->getnext(HTMLfileCache, &obj, true) == true)
5354 {
5355 HTMLfile *f = (HTMLfile *) obj.data;
5356
5357 unfragize(f->fragments, NULL, TRUE);
5358 }
5359 HTMLfileCache->unlock(HTMLfileCache);
5360 HTMLfileCache->free(HTMLfileCache);
5361 }
5362 if (mimeTypes) mimeTypes->free(mimeTypes);
5338 if (dbRequests) dbRequests->free(dbRequests); 5363 if (dbRequests) dbRequests->free(dbRequests);
5339 if (database) mysql_close(database); 5364 if (database) mysql_close(database);
5340 mysql_library_end(); 5365 mysql_library_end();
@@ -5942,7 +5967,7 @@ goto sendReply;
5942 goto sendReply; 5967 goto sendReply;
5943 5968
5944 getStats(database, stats); 5969 getStats(database, stats);
5945 unfragize(thisFile->fragments, Rd, false); 5970 unfragize(thisFile->fragments, Rd, FALSE);
5946 free(thisFile); 5971 free(thisFile);
5947 5972
5948sendReply: 5973sendReply: