mirror of
https://github.com/utkumaden/libmx.git
synced 2025-01-23 05:56:33 +01:00
Fix memory leak in static options parser.
This commit is contained in:
parent
1c75c9d7c5
commit
9fed914164
@ -132,7 +132,7 @@ MX_API void mx_options_end_r(mx_options_t *self);
|
|||||||
*/
|
*/
|
||||||
MX_INLINE mx_options_t* __mx_options_ptr()
|
MX_INLINE mx_options_t* __mx_options_ptr()
|
||||||
{
|
{
|
||||||
static mx_options_t opts = { };
|
static mx_options_t opts = { 0 };
|
||||||
return &opts;
|
return &opts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +144,7 @@ MX_INLINE mx_options_t* __mx_options_ptr()
|
|||||||
*/
|
*/
|
||||||
MX_INLINE void mx_options_begin(mx_optflag_t flags, int argc, char **argv)
|
MX_INLINE void mx_options_begin(mx_optflag_t flags, int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
mx_options_end_r(__mx_options_ptr());
|
||||||
mx_options_begin_r(__mx_options_ptr(), flags, argc, argv);
|
mx_options_begin_r(__mx_options_ptr(), flags, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user