[balsa/gtk3] Limit scope of FILE pointer
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Limit scope of FILE pointer
- Date: Mon, 16 Jul 2012 02:58:49 +0000 (UTC)
commit 377ea935b43fb24026cb62c3b4ad317efc896824
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sun Jul 15 22:37:01 2012 -0400
Limit scope of FILE pointer
* libbalsa/identity.c (libbalsa_identity_get_signature): limit
scope of fp.
ChangeLog | 5 +++++
libbalsa/identity.c | 5 ++++-
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bf297aa..f7e0775 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-07-15 Peter Bloomfield
+ * libbalsa/identity.c (libbalsa_identity_get_signature): limit
+ scope of fp.
+
+2012-07-15 Peter Bloomfield
+
* src/sendmsg-window.c (edit_with_gnome): plug mem leak.
2012-07-15 Peter Bloomfield
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 583dfd2..ece9928 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -324,7 +324,6 @@ libbalsa_identity_set_sig_prepend(LibBalsaIdentity* ident, gboolean prepend)
gchar*
libbalsa_identity_get_signature(LibBalsaIdentity* identity, GtkWindow *parent)
{
- FILE *fp = NULL;
gchar *ret = NULL, *path;
if (identity->signature_path == NULL ||
@@ -333,6 +332,8 @@ libbalsa_identity_get_signature(LibBalsaIdentity* identity, GtkWindow *parent)
path = libbalsa_expand_path(identity->signature_path);
if(identity->sig_executable){
+ FILE *fp;
+
/* signature is executable */
fp = popen(path,"r");
if (fp) {
@@ -344,6 +345,8 @@ libbalsa_identity_get_signature(LibBalsaIdentity* identity, GtkWindow *parent)
_("Error executing signature generator %s"),
identity->signature_path);
} else {
+ FILE *fp;
+
/* sign is normal file */
fp = fopen(path, "r");
if (fp) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]