projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8370691
)
* several memoryleaks
author
Wilfried Göesgens
<willi@citadel.org>
Thu, 31 Jul 2008 21:15:44 +0000
(21:15 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Thu, 31 Jul 2008 21:15:44 +0000
(21:15 +0000)
webcit/context_loop.c
patch
|
blob
|
history
webcit/gettext.c
patch
|
blob
|
history
webcit/messages.c
patch
|
blob
|
history
webcit/notes.c
patch
|
blob
|
history
webcit/preferences.c
patch
|
blob
|
history
webcit/serv_func.c
patch
|
blob
|
history
webcit/webcit.c
patch
|
blob
|
history
webcit/webcit.h
patch
|
blob
|
history
webcit/webserver.c
patch
|
blob
|
history
diff --git
a/webcit/context_loop.c
b/webcit/context_loop.c
index 4e10f92b230f08f92779ffe1640daf15e617213b..4fe4a2dda75dddaf8b1874df42f954e47aff8cbd 100644
(file)
--- a/
webcit/context_loop.c
+++ b/
webcit/context_loop.c
@@
-105,6
+105,7
@@
void do_housekeeping(void)
FreeStrBuf(&(sessions_to_kill->UrlFragment1));
FreeStrBuf(&(sessions_to_kill->UrlFragment2));
FreeStrBuf(&(sessions_to_kill->WBuf));
FreeStrBuf(&(sessions_to_kill->UrlFragment1));
FreeStrBuf(&(sessions_to_kill->UrlFragment2));
FreeStrBuf(&(sessions_to_kill->WBuf));
+ FreeStrBuf(&(sessions_to_kill->HBuf));
pthread_mutex_unlock(&sessions_to_kill->SessionMutex);
sptr = sessions_to_kill->next;
pthread_mutex_unlock(&sessions_to_kill->SessionMutex);
sptr = sessions_to_kill->next;
@@
-516,7
+517,10
@@
void context_loop(int sock)
#endif
DeleteHash(&TheSession->urlstrings);
DeleteHash(&TheSession->vars);
#endif
DeleteHash(&TheSession->urlstrings);
DeleteHash(&TheSession->vars);
-
+ FreeStrBuf(&TheSession->WBuf);
+ FreeStrBuf(&TheSession->HBuf);
+
+
pthread_mutex_unlock(&TheSession->SessionMutex); /* unbind */
/* Free the request buffer */
pthread_mutex_unlock(&TheSession->SessionMutex); /* unbind */
/* Free the request buffer */
diff --git
a/webcit/gettext.c
b/webcit/gettext.c
index f044ab6ac9ac9f619f4baeee22797f2ed969c090..52332f8152b64a4db519d1e8403c808749969745 100644
(file)
--- a/
webcit/gettext.c
+++ b/
webcit/gettext.c
@@
-270,6
+270,11
@@
void preset_locale(void)
#endif
#endif
}
#endif
#endif
}
+
+#ifdef HAVE_USELOCALE
+ locale_t Empty_Locale;
+#endif
+
/**
* \brief Create a locale_t for each available language
*/
/**
* \brief Create a locale_t for each available language
*/
@@
-278,8
+283,6
@@
void initialize_locales(void) {
char buf[32];
#ifdef HAVE_USELOCALE
char buf[32];
#ifdef HAVE_USELOCALE
- locale_t Empty_Locale;
-
/* create default locale */
Empty_Locale = newlocale(LC_ALL_MASK, NULL, NULL);
#endif
/* create default locale */
Empty_Locale = newlocale(LC_ALL_MASK, NULL, NULL);
#endif
@@
-310,6
+313,17
@@
void initialize_locales(void) {
}
}
}
}
+void ShutdownLocale(void)
+{
+ int i;
+#ifdef HAVE_USELOCALE
+ for (i = 0; i < NUM_LANGS; ++i) {
+ if (Empty_Locale != wc_locales[i])
+ freelocale(wc_locales[i]);
+ }
+ freelocale(Empty_Locale);
+#endif
+}
#else /* ENABLE_NLS */
/** \brief dummy for non NLS enabled systems */
#else /* ENABLE_NLS */
/** \brief dummy for non NLS enabled systems */
diff --git
a/webcit/messages.c
b/webcit/messages.c
index e7f007484a2fa66e3456c9903dd08c6dddbb6d8d..972da57ad998c99b397daadc1194201b0126160b 100644
(file)
--- a/
webcit/messages.c
+++ b/
webcit/messages.c
@@
-2475,7
+2475,8
@@
void readloop(char *oper)
sortpref_value = NULL;
sortpref_value = sortby;
}
sortpref_value = NULL;
sortpref_value = sortby;
}
-
+ FreeStrBuf(&sortby);
+
FreeStrBuf(&sortpref_name);
SortBy = StrToESort(sortpref_value);
/** message board sort */
FreeStrBuf(&sortpref_name);
SortBy = StrToESort(sortpref_value);
/** message board sort */
diff --git
a/webcit/notes.c
b/webcit/notes.c
index 497251d3997c81e25e910e207b0e8c2aa9b42075..0775d9709d11e083adecdf2f993176beb47d8cd9 100644
(file)
--- a/
webcit/notes.c
+++ b/
webcit/notes.c
@@
-227,13
+227,16
@@
struct vnote *vnote_new_from_msg(long msgnum) {
void write_vnote_to_server(struct vnote *v)
{
char buf[1024];
void write_vnote_to_server(struct vnote *v)
{
char buf[1024];
+ char *pch;
serv_puts("ENT0 1|||4");
serv_getln(buf, sizeof buf);
if (buf[0] == '4') {
serv_puts("Content-type: text/vnote");
serv_puts("");
serv_puts("ENT0 1|||4");
serv_getln(buf, sizeof buf);
if (buf[0] == '4') {
serv_puts("Content-type: text/vnote");
serv_puts("");
- serv_puts(vnote_serialize(v));
+ pch = vnote_serialize(v);
+ serv_puts(pch);
+ free(pch);
serv_puts("000");
}
}
serv_puts("000");
}
}
diff --git
a/webcit/preferences.c
b/webcit/preferences.c
index 79ec5d0504427041936c2ffa7d5988156a5b27fa..11ad3f34fc753c61496a8ea98589fefeee7fe490 100644
(file)
--- a/
webcit/preferences.c
+++ b/
webcit/preferences.c
@@
-78,6
+78,7
@@
void load_preferences(void) {
}
FreeStrBuf(&Key);
}
}
FreeStrBuf(&Key);
}
+ FreeStrBuf(&ReadBuf);
}
}
}
}
diff --git
a/webcit/serv_func.c
b/webcit/serv_func.c
index 50a7ab8b46db6e2a2f1679214721bee48e33df94..a9ff29458403911fba1438fd61841caa65a80bf1 100644
(file)
--- a/
webcit/serv_func.c
+++ b/
webcit/serv_func.c
@@
-384,6
+384,7
@@
int read_server_binary(StrBuf *Ret, size_t total_len)
}
}
}
}
}
}
+ FreeStrBuf(&Buf);
return StrLength(Ret);
}
return StrLength(Ret);
}
diff --git
a/webcit/webcit.c
b/webcit/webcit.c
index fc3a35f2a224bfa91fcd57dc48251945516e8f59..0c0b95845a0f9c059fb0d71cf1aa593a7fa68160 100644
(file)
--- a/
webcit/webcit.c
+++ b/
webcit/webcit.c
@@
-115,8
+115,10
@@
void addurls(char *url, long ulen)
aptr = up;
while ((aptr < eptr) && (*aptr != '\0') && (*aptr != '='))
aptr++;
aptr = up;
while ((aptr < eptr) && (*aptr != '\0') && (*aptr != '='))
aptr++;
- if (*aptr != '=')
+ if (*aptr != '=') {
+ free(buf);
return;
return;
+ }
*aptr = '\0';
aptr++;
bptr = aptr;
*aptr = '\0';
aptr++;
bptr = aptr;
@@
-877,7
+879,6
@@
void output_image()
{
struct wcsession *WCC = WC;
char buf[SIZ];
{
struct wcsession *WCC = WC;
char buf[SIZ];
- char *xferbuf = NULL;
off_t bytes;
const char *MimeType;
off_t bytes;
const char *MimeType;
@@
-885,7
+886,6
@@
void output_image()
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
bytes = extract_long(&buf[4], 0);
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
bytes = extract_long(&buf[4], 0);
- xferbuf = malloc(bytes + 2);
/** Read it from the server */
/** Read it from the server */
@@
-1361,7
+1361,7
@@
void session_loop(struct httprequest *req)
WCC= WC;
if (WCC->WBuf == NULL)
WCC= WC;
if (WCC->WBuf == NULL)
- WC
C->WBuf = NewStrBuf(
);
+ WC
->WBuf = NewStrBufPlain(NULL, 32768
);
FlushStrBuf(WCC->WBuf);
if (WCC->HBuf == NULL)
FlushStrBuf(WCC->WBuf);
if (WCC->HBuf == NULL)
diff --git
a/webcit/webcit.h
b/webcit/webcit.h
index 1e02177b5a821915bef29c9689fbba19c1bb2d0f..19f176b312f29d56e68e10816f276d0b47429178 100644
(file)
--- a/
webcit/webcit.h
+++ b/
webcit/webcit.h
@@
-699,6
+699,7
@@
int ical_ctdl_is_overlap(
#ifdef ENABLE_NLS
void initialize_locales(void);
#ifdef ENABLE_NLS
void initialize_locales(void);
+void ShutdownLocale(void);
#endif
extern char *months[];
#endif
extern char *months[];
diff --git
a/webcit/webserver.c
b/webcit/webserver.c
index 56a34eb063d819be8435bedf38d7165f461987c8..c8c117450264d9c1441eccd95d4f0ff93b33a5b5 100644
(file)
--- a/
webcit/webserver.c
+++ b/
webcit/webserver.c
@@
-242,7
+242,8
@@
int client_read_to(int sock, char *buf, int bytes, int timeout)
*/
void begin_burst(void)
{
*/
void begin_burst(void)
{
- WC->WBuf = NewStrBufPlain(NULL, 32768);
+ if (WC->WBuf == NULL)
+ WC->WBuf = NewStrBufPlain(NULL, 32768);
}
}
@@
-934,6
+935,10
@@
void worker_entry(void)
icaltimezone_release_zone_tab ();
icalmemory_free_ring ();
ShutDownLibCitadel ();
icaltimezone_release_zone_tab ();
icalmemory_free_ring ();
ShutDownLibCitadel ();
+ DeleteHash(&HandlerHash);
+#ifdef ENABLE_NLS
+ void ShutdownLocale(void);
+#endif
lprintf(2, "master shutdown exiting!.\n");
exit(0);
}
lprintf(2, "master shutdown exiting!.\n");
exit(0);
}