commit 154136a7cbb8c64d18a1c5a3b62cbf45bcb56f2c
parent 392c23c9c586d1f99c08df87f1cd3306e1ca5cd3
Author: Chris Allegretta <chrisa@asty.org>
Date: Wed, 23 Feb 2011 03:09:23 +0000
2011-02-22 Chris Allegretta <chrisa@asty.org>
* color.c (nfreeregex): Fix that we were trying to set the pointer passed by value
to NULL. Fixes crashes on file save reported by Ken Tyler and Matthieu Lejeune.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-22 Chris Allegretta <chrisa@asty.org>
+ * color.c (nfreeregex): Fix that we were trying to set the pointer passed by value
+ to NULL. Fixes crashes on file save reported by Ken Tyler and Matthieu Lejeune.
+
2011-02-18 Chris Allegretta <chrisa@asty.org>
* New saved cursor position history option. Command line option -P or --poslog, rc file
entry "poslog". Search history changes to ~/.nano/search_history, cursor position log
@@ -7,7 +11,7 @@
4.15 discussing the change and offering an interoperability workaround.
* files.c (load_history): Set last_search to the last search value we loaded from history,
so do_research will succeed without needing to manually load the last seach in. Fixes
- bug reported by Matt "ML" at gmail.
+ bug reported by Matthieu Lejeune.
2011-02-12 Chris Allegretta <chrisa@asty.org>
* Initial libmagic implementation, adapted from Eitan Adler <eitanadlerlist@gmail.com>.
diff --git a/src/color.c b/src/color.c
@@ -108,13 +108,13 @@ void color_init(void)
}
/* Cleanup a regex we previously compiled */
-void nfreeregex(regex_t *r)
+void nfreeregex(regex_t **r)
{
assert(r != NULL);
- regfree(r);
- free(r);
- r = NULL;
+ regfree(*r);
+ free(*r);
+ *r = NULL;
}
/* Update the color information based on the current filename. */
@@ -219,7 +219,7 @@ void color_update(void)
/* Decompile e->ext_regex's specified regex if we aren't
* going to use it. */
if (not_compiled)
- nfreeregex(e->ext);
+ nfreeregex(&e->ext);
}
}
@@ -251,7 +251,7 @@ void color_update(void)
}
if (not_compiled)
- nfreeregex(e->ext);
+ nfreeregex(&e->ext);
}
}
}
@@ -292,7 +292,7 @@ void color_update(void)
/* Decompile e->ext_regex's specified regex if we aren't
* going to use it. */
if (not_compiled)
- nfreeregex(e->ext);
+ nfreeregex(&e->ext);
}
}
}