summaryrefslogtreecommitdiffstats
path: root/src/bencoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bencoding.c')
-rw-r--r--src/bencoding.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bencoding.c b/src/bencoding.c
index 66b43b3..b32e2ea 100644
--- a/src/bencoding.c
+++ b/src/bencoding.c
@@ -738,10 +738,8 @@ struct bencoding * bclone (struct bencoding * b) {
c->child = bclone(b->child);
c->child->parent = c;
}
- if (b->next) {
- c->next = bclone(b->child);
- c->next->parent = c;
- }
+ if (b->next && (c->next = bclone(b->child)) && (c->next->parent = c))
+ {}
c->valuelen = b->valuelen;
if (b->value) {
c->value = malloc(c->valuelen+1);