If !WORDS_BIGENDIAN, it is pointless to test whether buf
is NULL, because it is initialized to NULL and never changed.
This makes Coverity complain, so we can just move all handling
of "buf" under the #ifdef.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
{
errcode_t retval;
char *write_buf;
+#ifdef WORDS_BIGENDIAN
char *buf = NULL;
-#ifdef WORDS_BIGENDIAN
retval = ext2fs_get_mem(fs->blocksize, &buf);
if (retval)
return retval;
write_buf = (char *) inbuf;
#endif
retval = io_channel_write_blk64(fs->io, block, 1, write_buf);
- if (buf)
- ext2fs_free_mem(&buf);
+#ifdef WORDS_BIGENDIAN
+ ext2fs_free_mem(&buf);
+#endif
if (!retval)
ext2fs_mark_changed(fs);
return retval;