regcomp.c: Don't write to freed memory
authorKarl Williamson <public@khwilliamson.com>
Thu, 10 Jan 2013 20:28:49 +0000 (13:28 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 10 Jan 2013 20:40:42 +0000 (13:40 -0700)
commit074331bb276f0a3ccd2f459327a9d9d5e39de87d
tree9ef6e58763ba896411fcffa194373cc000ec3c2c
parent8134d388d7c592f1dccd78e671b01ae8c5f77d9a
regcomp.c: Don't write to freed memory

This commit moves code in two places that may have freed memory just
before writing to it, so that the writing happens before the freeing.

It seems not worth the extra test if we are going to free this memory
before actually doing the write.

This bug was found by valgrind
regcomp.c