err = GetScrapFlavorCount (scrap, &count);
if (err == noErr)
flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
- if (flavor_info)
+ err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
+ if (err != noErr)
{
- err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
- if (err != noErr)
- {
- xfree (flavor_info);
- flavor_info = NULL;
- }
+ xfree (flavor_info);
+ flavor_info = NULL;
}
if (flavor_info == NULL)
count = 0;
deferred_apple_events.count = 0;
deferred_apple_events.buf =
xmalloc (sizeof (AppleEvent) * deferred_apple_events.size);
- if (deferred_apple_events.buf == NULL)
- err = memFullErr;
}
else if (deferred_apple_events.count == deferred_apple_events.size)
{
- AppleEvent *newbuf;
-
deferred_apple_events.size *= 2;
- newbuf = xrealloc (deferred_apple_events.buf,
- sizeof (AppleEvent) * deferred_apple_events.size);
- if (newbuf)
- deferred_apple_events.buf = newbuf;
- else
- err = memFullErr;
+ deferred_apple_events.buf
+ = xrealloc (deferred_apple_events.buf,
+ sizeof (AppleEvent) * deferred_apple_events.size);
}
}
buf = NULL;
}
else if (size_allocated < size)
- {
- char *newbuf = xrealloc (buf, size);
-
- if (newbuf)
- buf = newbuf;
- else
- {
- xfree (buf);
- buf = NULL;
- }
- }
+ buf = xrealloc (buf, size);
else
break;
}
err = GetScrapFlavorCount (cur_scrap, &count);
if (err == noErr)
flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
- if (flavor_info)
+ err = GetScrapFlavorInfoList (cur_scrap, &count, flavor_info);
+ if (err != noErr)
{
- err = GetScrapFlavorInfoList (cur_scrap, &count, flavor_info);
- if (err != noErr)
- {
- xfree (flavor_info);
- flavor_info = NULL;
- }
+ xfree (flavor_info);
+ flavor_info = NULL;
}
if (flavor_info == NULL)
break;