buffer=(unsigned char *) RelinquishMagickMemory(buffer);
if ((file == -1) || (i < length))
{
- if (file == -1)
+ if (file != -1)
file=close(file);
ThrowFileException(exception,BlobError,"UnableToWriteBlob",filename);
return(MagickFalse);
sizeof(one));
if (status == -1)
{
- (void) close(status);
+ (void) close(server_socket);
continue;
}
status=bind(server_socket,p->ai_addr,p->ai_addrlen);
if (status == -1)
{
- (void) close(status);
+ (void) close(server_socket);
continue;
}
break;
size_t
mask;
+ if (LogHandlers[j].name == (const char *) NULL)
+ break;
mask=1;
mask<<=j;
if ((log_info[i]->handler_mask & mask) != 0)
(void) FormatLocaleFile(file,"%s ",LogHandlers[j].name);
length+=strlen(LogHandlers[j].name);
}
- if (LogHandlers[j].name == (const char *) NULL)
- break;
}
for (j=(ssize_t) length; j <= 12; j++)
(void) FormatLocaleFile(file," ");
tag=(ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image);
length=(size_t) ReadBlobLSBLong(image);
if (tag == 0xFFFEE0DD)
- break; /* sequence delimiter tag */
+ {
+ (void) fclose(file);
+ break; /* sequence delimiter tag */
+ }
if (tag != 0xFFFEE000)
{
(void) fclose(file);
keyword[i]=tolower((int) ((unsigned char) keyword[i]));
}
keyword[i]='\0';
- (void) ResetMagickMemory(value,0,sizeof(value));
count=ReadBlob(image,72,(unsigned char *) value);
+ value[72]='\0';
if (count != 72)
break;
p=value;
file=fdopen(unique_file,"wb");
if ((unique_file == -1) || (file == (FILE *) NULL))
{
+ if (file != (FILE *) NULL)
+ (void) fclose(file);
(void) CopyMagickString(image->filename,read_info->filename,
MaxTextExtent);
ThrowFileException(exception,FileOpenError,