aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2009-07-15 18:48:43 +0000
committerFrederic Culot <calcurse@culot.org>2009-07-15 18:48:43 +0000
commit3fe85503732c885bd3833b9c1c56a8a70d45f253 (patch)
tree634a2e3b530cd83cd847cd89b2caec59169a1f6a
parent56a29600ad7a1e91fe0b0b0f3747092552319a46 (diff)
downloadcalcurse-3fe85503732c885bd3833b9c1c56a8a70d45f253.tar.gz
calcurse-3fe85503732c885bd3833b9c1c56a8a70d45f253.zip
Fixed a bug related to memory management (a free on a null pointer causes an abort now, which induces side effects on file import).
-rwxr-xr-xChangeLog5
-rwxr-xr-xsrc/io.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d358a7..14eb99a 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-15 Frederic Culot <frederic@culot.org>
+
+ * src/io.c: could not import ical files anymore if notes were not
+ attached to items (thanks Chris for reporting it)
+
2009-07-12 Frederic Culot <frederic@culot.org>
* configure.ac
diff --git a/src/io.c b/src/io.c
index 05b24db..582d91e 100755
--- a/src/io.c
+++ b/src/io.c
@@ -1,4 +1,4 @@
-/* $calcurse: io.c,v 1.68 2009/07/12 17:48:13 culot Exp $ */
+/* $calcurse: io.c,v 1.69 2009/07/15 18:48:44 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -1666,7 +1666,8 @@ ical_store_todo (int priority, char *mesg, char *note)
{
todo_add (mesg, priority, note);
mem_free (mesg);
- mem_free (note);
+ if (note)
+ mem_free (note);
}
static void
@@ -1720,7 +1721,8 @@ ical_store_apoint (char *mesg, char *note, long start, long dur,
apoint_new (mesg, note, start, dur, state);
}
mem_free (mesg);
- mem_free (note);
+ if (note)
+ mem_free (note);
}
/*