minor cleanup for static analyser

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32514 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-03-09 10:53:25 +00:00
parent cc2de01684
commit ca3e96799a
2 changed files with 13 additions and 2 deletions

View file

@ -527,10 +527,17 @@ extern "C" {
@interface GSXMLRPC : NSObject <NSURLHandleClient>
{
@private
#if defined(GNUSTEP)
NSURLHandle *handle;
NSString *connectionURL GS_UNUSED_IVAR;
NSURLConnection *connection GS_UNUSED_IVAR;
NSMutableData *response GS_UNUSED_IVAR;
#else
id handle GS_UNUSED_IVAR;
NSString *connectionURL;
NSURLConnection *connection;
NSMutableData *response;
#endif
NSTimer *timer;
id result;
id delegate; // Not retained.

View file

@ -148,8 +148,12 @@ static BOOL cacheDone = NO;
static char * xml_strdup(const char *from)
{
unsigned len = (from == 0) ? 1 : (strlen(from) + 1);
char *to = malloc(len);
unsigned len;
char *to;
if (0 == from) from = "";
len = strlen(from) + 1;
to = malloc(len);
memcpy(to, from, len);
return to;
}