mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-19 10:01:24 +00:00
fix leaks
This commit is contained in:
parent
47f0660a03
commit
ca372cf1e2
1 changed files with 16 additions and 13 deletions
29
EcConsole.m
29
EcConsole.m
|
@ -508,9 +508,8 @@ static NSString *originalUserName = nil;
|
||||||
{
|
{
|
||||||
NSString *reject;
|
NSString *reject;
|
||||||
|
|
||||||
[rnam release];
|
ASSIGN(rnam,
|
||||||
rnam = [NSString stringWithFormat: @"%@:%@", user, local];
|
([NSString stringWithFormat: @"%@:%@", user, local]));
|
||||||
[rnam retain];
|
|
||||||
|
|
||||||
[server retain];
|
[server retain];
|
||||||
[server setProtocolForProxy: @protocol(Control)];
|
[server setProtocolForProxy: @protocol(Control)];
|
||||||
|
@ -813,7 +812,7 @@ static NSString *originalUserName = nil;
|
||||||
pass = [[env objectForKey: @"ConsolePass"] retain];
|
pass = [[env objectForKey: @"ConsolePass"] retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
rnam = [[NSString stringWithFormat: @"%@:%@", user, local] retain];
|
ASSIGN(rnam, ([NSString stringWithFormat: @"%@:%@", user, local]));
|
||||||
|
|
||||||
if (user && pass)
|
if (user && pass)
|
||||||
{
|
{
|
||||||
|
@ -1060,15 +1059,19 @@ static EcConsole *rlConsole = nil;
|
||||||
static void
|
static void
|
||||||
readlineReadALine(char *_line)
|
readlineReadALine(char *_line)
|
||||||
{
|
{
|
||||||
NSString *s = _line ? [[NSString alloc] initWithCString: _line] : nil;
|
NSString *s = nil;
|
||||||
|
|
||||||
[rlConsole doLine: s];
|
if (_line)
|
||||||
|
|
||||||
if (_line != NULL && strlen(_line) > 0)
|
|
||||||
{
|
{
|
||||||
add_history(_line);
|
s = [[NSString alloc] initWithCString: _line];
|
||||||
|
if (strlen(_line) > 0)
|
||||||
|
{
|
||||||
|
add_history(_line);
|
||||||
|
}
|
||||||
|
free(_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[rlConsole doLine: s];
|
||||||
DESTROY(s);
|
DESTROY(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1219,8 +1222,8 @@ consoleCompleter(const char *text, int start, int end)
|
||||||
|
|
||||||
self->user = [u retain];
|
self->user = [u retain];
|
||||||
self->pass = [p retain];
|
self->pass = [p retain];
|
||||||
self->rnam =
|
ASSIGN(self->rnam,
|
||||||
[[NSString alloc] initWithFormat: @"%@:%@", self->user, self->local];
|
([NSString stringWithFormat: @"%@:%@", self->user, self->local]));
|
||||||
|
|
||||||
reject = [self->server registerConsole: self
|
reject = [self->server registerConsole: self
|
||||||
name: self->rnam
|
name: self->rnam
|
||||||
|
|
Loading…
Reference in a new issue