?
=?ISO-8859-2?Q?Jaros=B3aw_Rafa?=
Hello,
I have a question about the regular expression functions from #include
<regex.h>. The regcomp() function compiles a regular expressions and "in
the background" allocates some memory for the compiled RE. You can free
that memory with regfree() if you don't need the RE anymore.
BUT the question is: if I want to change the RE, and re-compile it using
*the same regex_t structure* in regcomp(), do I have to call regfree()
first to free the memory allocated to old compiled RE, or can I just
call regcomp(), and it will free or reallocate the memory by itself (so
that there won't be a memory leak)?
I have a question about the regular expression functions from #include
<regex.h>. The regcomp() function compiles a regular expressions and "in
the background" allocates some memory for the compiled RE. You can free
that memory with regfree() if you don't need the RE anymore.
BUT the question is: if I want to change the RE, and re-compile it using
*the same regex_t structure* in regcomp(), do I have to call regfree()
first to free the memory allocated to old compiled RE, or can I just
call regcomp(), and it will free or reallocate the memory by itself (so
that there won't be a memory leak)?