aboutsummaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c
index 85ce1171..92357703 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -576,13 +576,14 @@ char *ssh_path_expand_tilde(const char *d) {
r = malloc(ld + lh + 1);
if (r == NULL) {
+ SAFE_FREE(h);
return NULL;
}
if (lh > 0) {
memcpy(r, h, lh);
- SAFE_FREE(h);
}
+ SAFE_FREE(h);
memcpy(r + lh, p, ld + 1);
return r;