summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/header.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/header.c b/lib/header.c
index 45bbc2dd8..c4cc78e06 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -456,6 +456,8 @@ static void * doHeaderUnload(Header h,
int i;
int drlen, ndribbles;
+ if (h == NULL) return NULL;
+
/* Sort entries by (offset,tag). */
headerUnsort(h);
@@ -1013,8 +1015,6 @@ int headerWrite(FD_t fd, Header h, enum hMagic magicp)
size_t length;
void * uh;
- if (h == NULL)
- return 1;
uh = doHeaderUnload(h, &length);
if (uh == NULL)
return 1;