mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-15 16:11:01 +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;
|
||||
|
||||
[rnam release];
|
||||
rnam = [NSString stringWithFormat: @"%@:%@", user, local];
|
||||
[rnam retain];
|
||||
ASSIGN(rnam,
|
||||
([NSString stringWithFormat: @"%@:%@", user, local]));
|
||||
|
||||
[server retain];
|
||||
[server setProtocolForProxy: @protocol(Control)];
|
||||
|
@ -813,7 +812,7 @@ static NSString *originalUserName = nil;
|
|||
pass = [[env objectForKey: @"ConsolePass"] retain];
|
||||
}
|
||||
|
||||
rnam = [[NSString stringWithFormat: @"%@:%@", user, local] retain];
|
||||
ASSIGN(rnam, ([NSString stringWithFormat: @"%@:%@", user, local]));
|
||||
|
||||
if (user && pass)
|
||||
{
|
||||
|
@ -1060,15 +1059,19 @@ static EcConsole *rlConsole = nil;
|
|||
static void
|
||||
readlineReadALine(char *_line)
|
||||
{
|
||||
NSString *s = _line ? [[NSString alloc] initWithCString: _line] : nil;
|
||||
|
||||
[rlConsole doLine: s];
|
||||
|
||||
if (_line != NULL && strlen(_line) > 0)
|
||||
NSString *s = nil;
|
||||
|
||||
if (_line)
|
||||
{
|
||||
add_history(_line);
|
||||
s = [[NSString alloc] initWithCString: _line];
|
||||
if (strlen(_line) > 0)
|
||||
{
|
||||
add_history(_line);
|
||||
}
|
||||
free(_line);
|
||||
}
|
||||
|
||||
|
||||
[rlConsole doLine: s];
|
||||
DESTROY(s);
|
||||
}
|
||||
|
||||
|
@ -1219,8 +1222,8 @@ consoleCompleter(const char *text, int start, int end)
|
|||
|
||||
self->user = [u retain];
|
||||
self->pass = [p retain];
|
||||
self->rnam =
|
||||
[[NSString alloc] initWithFormat: @"%@:%@", self->user, self->local];
|
||||
ASSIGN(self->rnam,
|
||||
([NSString stringWithFormat: @"%@:%@", self->user, self->local]));
|
||||
|
||||
reject = [self->server registerConsole: self
|
||||
name: self->rnam
|
||||
|
|
Loading…
Reference in a new issue