aboutsummaryrefslogtreecommitdiffstats
path: root/main/quvi/fix-memcorruption.patch
blob: 4ffe254503d8a838b2064a6d43b952bd46f5c018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff -ru quvi-0.9.5.orig/src/util/regex.c quvi-0.9.5/src/util/regex.c
--- quvi-0.9.5.orig/src/util/regex.c	2013-07-16 17:55:23.000000000 -0300
+++ quvi-0.9.5/src/util/regex.c	2014-12-02 08:41:56.003383594 -0200
@@ -194,9 +194,8 @@
   g_free(op->sequence);
   g_free(op->regex);
   g_free(op->mode);
-  g_free(op);
-
   memset(op, 0, sizeof(struct _lutil_regex_op_s));
+  g_free(op);
 }
 
 static gchar *_op_m(lutil_regex_op_t op, const gchar *s)
diff -ru quvi-0.9.5.orig/src/util/xchg.c quvi-0.9.5/src/util/xchg.c
--- quvi-0.9.5.orig/src/util/xchg.c	2013-11-10 09:58:30.000000000 -0200
+++ quvi-0.9.5/src/util/xchg.c	2014-12-02 08:42:55.756717512 -0200
@@ -260,9 +260,8 @@
 
   g_hash_table_destroy(p->htable);
   g_regex_unref(p->re);
-  g_free(p);
-
   memset(p, 0, sizeof(struct _lutil_xchg_seq_s));
+  g_free(p);
 }
 
 /* Replace the sequences in the given string (g_free the returned string). */