mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Fix CID 1134974
This commit is contained in:
parent
7ddcb83383
commit
a88b87fe49
@ -86,11 +86,15 @@ static char *getstr(const char *src) {
|
||||
}
|
||||
|
||||
static void parseline (char *b) {
|
||||
int must_free = R_FALSE;
|
||||
char *e = strchr (b, '=');
|
||||
if (!e) return;
|
||||
if (*b=='#') return;
|
||||
*e++ = 0;
|
||||
if (*e=='$') e = r_sys_getenv (e);
|
||||
if (*e=='$') {
|
||||
must_free = R_TRUE;
|
||||
e = r_sys_getenv (e);
|
||||
}
|
||||
if (e == NULL) return;
|
||||
if (!strcmp (b, "program")) _args[0] = _program = strdup (e);
|
||||
else if (!strcmp (b, "system")) _system = strdup (e);
|
||||
@ -145,6 +149,8 @@ static void parseline (char *b) {
|
||||
r_sys_setenv (e, v);
|
||||
}
|
||||
}
|
||||
if (must_free == R_TRUE)
|
||||
free (e);
|
||||
}
|
||||
|
||||
#if __UNIX__
|
||||
|
Loading…
Reference in New Issue
Block a user