[Pkg-privacy-commits] [irssi-plugin-otr] 95/267: Fix: double free of filename string

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit c82d534a4ff10bb706a5036379476ef67b859ff0
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Fri Nov 2 20:22:05 2012 -0400

    Fix: double free of filename string
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/key.c | 6 +++---
 src/otr.c | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/key.c b/src/key.c
index 4964c3c..ccf04f8 100644
--- a/src/key.c
+++ b/src/key.c
@@ -147,6 +147,7 @@ void key_generation_run(IOUSTATE *ioustate, const char *accname)
 		if (strcmp(accname, kg_st.accountname) != 0) {
 			otr_noticest(TXT_KG_ABORTED_DUP, accname, kg_st.accountname);
 		}
+		g_free(filenamedup);
 		goto end;
 	}
 
@@ -154,7 +155,7 @@ void key_generation_run(IOUSTATE *ioustate, const char *accname)
 		if (g_mkdir(dir, S_IRWXU)) {
 			otr_noticest(TXT_KG_ABORTED_DIR, accname, dir, strerror(errno));
 			g_free(dir);
-			g_free(filename);
+			g_free(filenamedup);
 			goto end;
 		} else {
 			otr_noticest(TXT_KG_MKDIR, dir);
@@ -166,7 +167,6 @@ void key_generation_run(IOUSTATE *ioustate, const char *accname)
 	ret = pipe(fds);
 	if (ret < 0) {
 		otr_noticest(TXT_KG_PIPE, accname, strerror(errno));
-		g_free(filename);
 		goto end;
 	}
 
@@ -208,6 +208,7 @@ void key_generation_run(IOUSTATE *ioustate, const char *accname)
 	exit(EXIT_SUCCESS);
 
 end:
+	g_free(filename);
 	return;
 }
 
@@ -343,7 +344,6 @@ void instag_load(IOUSTATE *ioustate)
 
 	if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
 		otr_noticest(TXT_INSTAG_NOT_FOUND);
-		g_free(filename);
 		goto end;
 	}
 
diff --git a/src/otr.c b/src/otr.c
index f7d80b3..2f703da 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -35,9 +35,8 @@ IOUSTATE *otr_init_user(char *user)
 
 	ioustate->otr_state = otrl_userstate_create();
 
-#ifndef LIBOTR3
 	instag_load(ioustate);
-#endif
+
 	/* Load keys and fingerprints. */
 	key_load(ioustate);
 	key_load_fingerprints(ioustate);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list