Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libstrophe leaks memory #28

Open
cizra opened this issue Aug 10, 2012 · 0 comments
Open

libstrophe leaks memory #28

cizra opened this issue Aug 10, 2012 · 0 comments

Comments

@cizra
Copy link

cizra commented Aug 10, 2012

After adding this patch:

diff --git a/examples/bot.c b/examples/bot.c
index 03ba9c8..8ace449 100644
--- a/examples/bot.c
+++ b/examples/bot.c
@@ -90,6 +90,11 @@ int message_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void

        body = xmpp_stanza_new(ctx);
        xmpp_stanza_set_name(body, "body");
+
+       if (strcmp(intext, "end") == 0) {
+               xmpp_stop(ctx);
+               return 1;
+       }

        replytext = malloc(strlen(" to you too!") + strlen(intext) + 1);
        strcpy(replytext, intext);

.. I tested the bot, and thus libstrophe, for memory leaks with Valgrind. Valgrind reports lots of leaks. The patches submitted in issues #27, #26, #18 didn't help much.

Here's the Valgrind log of the leaks: https://gist.github.com/3317999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant