cleanup allocated memory on error

(cherry picked from commit 4979d5f3)
18 jobs for 703-resource-leak-in-dlz_filesystem_driver-c-v9_12 in 8 minutes and 10 seconds (queued for 5 seconds)
Status Job ID Name Coverage
  Precheck
passed precheck:debian:sid:amd64 #98170
amd64 docker linux

00:00:22

 
  Build
passed build:centos:centos6:amd64 #98171
amd64 docker linux

00:02:09

passed build:centos:centos7:amd64 #98172
amd64 docker linux

00:02:21

passed build:debian:sid:amd64 #98173
amd64 docker linux

00:01:57

passed build:debian:sid:i386 #98174
i386 docker linux

00:01:59

passed noassert:build:debian:sid:amd64 #98175
amd64 docker linux

00:01:42

 
  Test
passed docs:debian:sid:amd64 #98176
amd64 docker linux

00:00:48

passed install:debian:sid:amd64 #98185
amd64 docker linux

00:02:03

passed noassert:systemtest:debian:sid:amd64 #98187
amd64 docker linux

00:05:04

passed noassert:unittest:debian:sid:amd64 #98186
amd64 docker linux

00:00:51

passed systemtest:centos:centos6:amd64 #98181
amd64 docker linux

00:05:09

passed systemtest:centos:centos7:amd64 #98182
amd64 docker linux

00:05:13

passed systemtest:debian:sid:amd64 #98183
amd64 docker linux

00:05:17

passed systemtest:debian:sid:i386 #98184
i386 docker linux

00:05:23

passed unittest:centos:centos6:amd64 #98177
amd64 docker linux

00:00:52

passed unittest:centos:centos7:amd64 #98178
amd64 docker linux

00:00:52

passed unittest:debian:sid:amd64 #98179
amd64 docker linux

00:00:46

passed unittest:debian:sid:i386 #98180
i386 docker linux

00:00:46