Index: dm_target_snapshot.c =================================================================== RCS file: /cvsroot/src/sys/dev/dm/dm_target_snapshot.c,v retrieving revision 1.16 diff -u -r1.16 dm_target_snapshot.c --- dm_target_snapshot.c 14 Jun 2014 07:39:00 -0000 1.16 +++ dm_target_snapshot.c 17 Aug 2014 18:00:37 -0000 @@ -221,8 +221,7 @@ if ((dmp_snap = dm_pdev_insert(argv[0])) == NULL) return ENOENT; - if ((tsc = kmem_alloc(sizeof(dm_target_snapshot_config_t), KM_NOSLEEP)) - == NULL) + if ((tsc = kmem_alloc(sizeof(*tsc), KM_NOSLEEP)) == NULL) return 1; tsc->tsc_persistent_dev = 0; @@ -232,8 +231,10 @@ tsc->tsc_persistent_dev = 1; /* Insert cow device to global pdev list */ - if ((dmp_cow = dm_pdev_insert(argv[1])) == NULL) + if ((dmp_cow = dm_pdev_insert(argv[1])) == NULL) { + kmem_free(tsc, sizeof(*tsc)); return ENOENT; + } } tsc->tsc_chunk_size = atoi(argv[3]);