Skip to content

Commit

Permalink
4061 libzfs: memory leak in iter_dependents_cb()
Browse files Browse the repository at this point in the history
Reviewed by: Jeffry Molanus <jeffry.molanus@nexenta.com>
Reviewed by: Boris Protopopov <boris.protopopov@nexenta.com>
Reviewed by: Andy Stormont <andyjstormont@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
  • Loading branch information
mtelka authored and Dan McDonald committed Aug 21, 2013
1 parent 713d6c2 commit 2fbdf8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usr/src/lib/libzfs/common/libzfs_iter.c
Expand Up @@ -21,8 +21,8 @@

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/

#include <stdio.h>
Expand Down Expand Up @@ -443,8 +443,12 @@ iter_dependents_cb(zfs_handle_t *zhp, void *arg)
err = zfs_iter_snapshots(zhp, iter_dependents_cb, ida);
ida->stack = isf.next;
}

if (!first && err == 0)
err = ida->func(zhp, ida->data);
else
zfs_close(zhp);

return (err);
}

Expand Down

0 comments on commit 2fbdf8d

Please sign in to comment.