First batch of corrections based on David's static analysis.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31337 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-09-12 16:34:22 +00:00
parent 26fcda321b
commit d08b23d9b0
15 changed files with 151 additions and 73 deletions

View file

@ -419,15 +419,17 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
- (id) initWithBitmapHandle: (void *)bitmap
{
NSImageRep *rep = [[NSBitmapImageRep alloc] initWithBitmapHandle: bitmap];
NSImageRep *rep;
if (!(self = [self init]))
return nil;
rep = [[NSBitmapImageRep alloc] initWithBitmapHandle: bitmap];
if (rep == nil)
{
RELEASE(self);
return nil;
}
if (!(self = [self init]))
return nil;
[self addRepresentation: rep];
RELEASE(rep);
@ -437,15 +439,17 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
- (id)initWithIconHandle:(void *)icon
{
// Only needed on MS Windows
NSImageRep *rep = [[NSBitmapImageRep alloc] initWithIconHandle: icon];
NSImageRep *rep;
if (!(self = [self init]))
return nil;
rep = [[NSBitmapImageRep alloc] initWithIconHandle: icon];
if (rep == nil)
{
RELEASE(self);
return nil;
}
if (!(self = [self init]))
return nil;
[self addRepresentation: rep];
RELEASE(rep);
@ -454,15 +458,17 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
- (id) initWithContentsOfURL: (NSURL *)anURL
{
NSArray *array = [NSImageRep imageRepsWithContentsOfURL: anURL];
NSArray *array;
if (!(self = [self init]))
return nil;
array = [NSImageRep imageRepsWithContentsOfURL: anURL];
if (!array)
{
RELEASE(self);
return nil;
}
if (!(self = [self init]))
return nil;
_flags.dataRetained = YES;
[self addRepresentations: array];
@ -477,7 +483,6 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
return nil;
reps = [NSImageRep imageRepsWithPasteboard: pasteboard];
if (reps != nil)
[self addRepresentations: reps];
else