fix another memory leak

In sys_early_init(), the values for sysopt.gdbpath and
sysopt.greppath were being assigned by calling dupstr()
without ensuring that a value previously assigned by
dupstr() were free()'d.

Also, the sysopt struct definition is changed to sysopt_s,
not because there's anything wrong with the original
    struct sysopt sysopt;
but because I couldn't convince the debugger to use the
correct thing when trying to track down the leak.
This commit is contained in:
nhmall
2024-11-13 09:07:10 -05:00
parent 277a0e4464
commit 5c28b9e987
2 changed files with 7 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
#ifndef SYS_H
#define SYS_H
struct sysopt {
struct sysopt_s {
char *support; /* local support contact */
char *recover; /* how to run recover - may be overridden by win port */
char *wizards; /* space-separated list of usernames */
@@ -60,7 +60,7 @@ struct sysopt {
* 1: suppress it */
};
extern struct sysopt sysopt;
extern struct sysopt_s sysopt;
#define SYSOPT_SEDUCE sysopt.seduce