projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9552c97
)
tal/path: fix unset vars in error paths.
author
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 11 Jun 2013 05:10:49 +0000
(14:40 +0930)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 11 Jun 2013 05:10:49 +0000
(14:40 +0930)
Compiling with optimization FTW.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/tal/path/path.c
patch
|
blob
|
history
diff --git
a/ccan/tal/path/path.c
b/ccan/tal/path/path.c
index e6e94dbe080dca24fcdb5ec02a4701381029647b..a0dbe291440e248fba0faddf6a70bf0062c0c009 100644
(file)
--- a/
ccan/tal/path/path.c
+++ b/
ccan/tal/path/path.c
@@
-244,8
+244,10
@@
char *path_rel(const tal_t *ctx, const char *from, const char *to)
/* This frees to if we're supposed to take it. */
cto = path_canon(tmpctx, to);
- if (!cto)
+ if (!cto) {
+ ret = NULL;
goto out;
+ }
/* How much is in common? */
for (common = i = 0; cfrom[i] && cto[i]; i++) {
@@
-323,7
+325,9
@@
fail_take_to:
goto fail;
}
- ret[len] = '\0';
+ if (ret)
+ ret[len] = '\0';
+
out:
if (taken(linkname))
tal_free(linkname);