cleanup allocated memory on error

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

00:00:20

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

00:02:34

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

00:02:47

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

00:01:59

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

00:02:02

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

00:02:19

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

00:00:51

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

00:03:23

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

00:04:31

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

00:01:03

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

00:04:47

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

00:04:37

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

00:04:34

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

00:04:43

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

00:01:05

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

00:01:02

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

00:01:05

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

00:00:59