--- a/xneur/lib/ai/detection.c Thu Nov 20 15:40:07 2014 +0300
+++ a/xneur/lib/ai/detection.c Fri Dec 12 16:44:50 2014 +0300
@@ -273,7 +273,10 @@
if (handle->languages[lang].disable_auto_detection || handle->languages[lang].excluded)
{
if (possible_words != NULL)
+ {
free (possible_words);
+ possible_words = NULL;
+ }
if (word != NULL)
free(word);
continue;
@@ -284,7 +287,10 @@
if ((word_len > 250) || (word_len < 2))
{
if (possible_words != NULL)
+ {
free (possible_words);
+ possible_words = NULL;
+ }
if (word != NULL)
free(word);
continue;
@@ -305,7 +311,10 @@
if (!handle->has_enchant_checker[lang])
{
if (possible_words != NULL)
+ {
free (possible_words);
+ possible_words = NULL;
+ }
if (word != NULL)
free(word);
continue;
@@ -336,7 +345,10 @@
if (!handle->has_spell_checker[lang])
{
if (possible_words != NULL)
+ {
free (possible_words);
+ possible_words = NULL;
+ }
if (word != NULL)
free(word);
continue;
@@ -345,7 +357,10 @@
if (! suggestions)
{
if (possible_words != NULL)
+ {
free (possible_words);
+ possible_words = NULL;
+ }
if (word != NULL)
free(word);
continue;
--- a/xneur/lib/main/program.c Thu Nov 20 15:40:07 2014 +0300
+++ a/xneur/lib/main/program.c Fri Dec 12 16:44:50 2014 +0300
@@ -1414,7 +1414,8 @@
if (!word)
return FALSE;
- if ((p->buffer->content[p->buffer->cur_pos-1] == ' ') ||
+ if ((p->buffer->cur_pos <= 0) ||
+ (p->buffer->content[p->buffer->cur_pos-1] == ' ') ||
(p->buffer->content[p->buffer->cur_pos-1] == 0) || // Nothing word
(p->buffer->content[p->buffer->cur_pos-1] == 13) || // Enter
(p->buffer->content[p->buffer->cur_pos-1] == 11)) // Tab
--- a/xneur/lib/notify/sound.c Thu Nov 20 15:40:07 2014 +0300
+++ a/xneur/lib/notify/sound.c Fri Dec 12 16:44:50 2014 +0300
@@ -302,7 +302,7 @@
static const char *program_name = "aplay";
- char *command = malloc((strlen(path) + strlen(program_name) + 1) * sizeof(char));
+ char *command = malloc((strlen(path) + strlen(program_name) + 2) * sizeof(char));
sprintf(command, "%s %s", program_name, path);
if (system(command) == -1)
log_message(ERROR, _("Can't execute command '%s'"), command);