Browse Source

ccanlint: fix abort on "-d ..".

Rusty Russell 15 years ago
parent
commit
0939b69164
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/tools.c

+ 1 - 1
tools/tools.c

@@ -28,7 +28,7 @@ char *talloc_basename(const void *ctx, const char *dir)
 	char *p = strrchr(dir, '/');
 	char *p = strrchr(dir, '/');
 
 
 	if (!p)
 	if (!p)
-		return (char *)dir;
+		return talloc_strdup(ctx, dir);
 	return talloc_strdup(ctx, p+1);
 	return talloc_strdup(ctx, p+1);
 }
 }