Whamcloud - gitweb
LU-13197 e2fsck: consistently use ext2fs_get_mem()
[tools/e2fsprogs.git] / misc / base_device.c
index aad2ba0..d1c1cd9 100644 (file)
@@ -18,6 +18,7 @@
  * License.
  * %End-Header%
  */
+#include "config.h"
 #include <stdio.h>
 #if HAVE_UNISTD_H
 #include <unistd.h>
@@ -149,7 +150,7 @@ errout:
 #ifdef DEBUG
 int main(int argc, char** argv)
 {
-       const char *base;
+       char *base;
        char  buf[256], *cp;
 
        while (1) {
@@ -163,6 +164,7 @@ int main(int argc, char** argv)
                        *cp = 0;
                base = base_device(buf);
                printf("%s\t%s\n", buf, base ? base : "NONE");
+               free(base);
        }
        exit(0);
 }