summaryrefslogtreecommitdiff
path: root/sys/src/libbio/brdstr.c
diff options
context:
space:
mode:
authorftrvxmtrx <devnull@localhost>2014-05-02 04:27:29 +0200
committerftrvxmtrx <devnull@localhost>2014-05-02 04:27:29 +0200
commitf7f3e4780a5e0733f8699b7722811fb0887af8f1 (patch)
treea81dac053f1f822479a191328853d95ec4d202d1 /sys/src/libbio/brdstr.c
parentbeb665051bc635299e905ecb8abc5dfd9c3f011e (diff)
bio: Brdstr, Bopen: set malloc tag to the caller
Diffstat (limited to 'sys/src/libbio/brdstr.c')
-rw-r--r--sys/src/libbio/brdstr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/src/libbio/brdstr.c b/sys/src/libbio/brdstr.c
index 0355ec3f6..5e27c033d 100644
--- a/sys/src/libbio/brdstr.c
+++ b/sys/src/libbio/brdstr.c
@@ -51,7 +51,8 @@ Brdstr(Biobufhdr *bp, int delim, int nulldelim)
if(ep) {
j = (ep - ip) + 1;
bp->icount += j;
- return badd(nil, &bp->rdline, ip, j, delim, nulldelim);
+ p = badd(nil, &bp->rdline, ip, j, delim, nulldelim);
+ goto out;
}
/*
@@ -72,7 +73,7 @@ Brdstr(Biobufhdr *bp, int delim, int nulldelim)
if(j < 0)
Berror(bp, "read error: %r");
if(j <= 0 && i == 0)
- return p;
+ goto out;
if(j <= 0 && i > 0){
/*
* end of file but no delim. pretend we got a delim
@@ -100,7 +101,8 @@ Brdstr(Biobufhdr *bp, int delim, int nulldelim)
}
j = (ep - (char*)bp->bbuf) + 1;
bp->icount = j - i;
- return badd(p, &bp->rdline, ip, j, delim, nulldelim);
+ p = badd(p, &bp->rdline, ip, j, delim, nulldelim);
+ goto out;
}
ip += j;
}
@@ -113,4 +115,7 @@ Brdstr(Biobufhdr *bp, int delim, int nulldelim)
bp->icount = 0;
bp->gbuf = bp->ebuf;
}
+out:
+ setmalloctag(p, getcallerpc(&bp));
+ return p;
}