shithub: riscv

Download patch

ref: 81618e61df9a640f756d6f9194904d0c817b98b9
parent: 1eb2c757e7ca64221b88e34c56e7e45aa10b3444
author: cinap_lenrek <[email protected]>
date: Fri Sep 6 12:55:13 EDT 2013

libc: set malloctag for runesmprint()

--- a/sys/src/libc/fmt/runesmprint.c
+++ b/sys/src/libc/fmt/runesmprint.c
@@ -10,5 +10,7 @@
 	va_start(args, fmt);
 	p = runevsmprint(fmt, args);
 	va_end(args);
+	if(p != nil)
+		setmalloctag(p, getcallerpc(&fmt));
 	return p;
 }
--- a/sys/src/libc/fmt/smprint.c
+++ b/sys/src/libc/fmt/smprint.c
@@ -10,6 +10,7 @@
 	va_start(args, fmt);
 	p = vsmprint(fmt, args);
 	va_end(args);
-	setmalloctag(p, getcallerpc(&fmt));
+	if(p != nil)
+		setmalloctag(p, getcallerpc(&fmt));
 	return p;
 }