aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/legacy/global_whereis.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-01-11 17:27:29 +0100
committerSverker Eriksson <[email protected]>2013-01-18 15:04:03 +0100
commitb553664f54034e8c04ae6f9cc44f16b7f516518b (patch)
tree1522c655fea9aa52476e997aa26f1512d3ecada4 /lib/erl_interface/src/legacy/global_whereis.c
parent97abb095cd2182d5c3fafd525da4943ef74dc8e5 (diff)
downloadotp-b553664f54034e8c04ae6f9cc44f16b7f516518b.tar.gz
otp-b553664f54034e8c04ae6f9cc44f16b7f516518b.tar.bz2
otp-b553664f54034e8c04ae6f9cc44f16b7f516518b.zip
erl_interface: utf8 atoms continued
Diffstat (limited to 'lib/erl_interface/src/legacy/global_whereis.c')
-rw-r--r--lib/erl_interface/src/legacy/global_whereis.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/erl_interface/src/legacy/global_whereis.c b/lib/erl_interface/src/legacy/global_whereis.c
index 2afb193504..e6c556d907 100644
--- a/lib/erl_interface/src/legacy/global_whereis.c
+++ b/lib/erl_interface/src/legacy/global_whereis.c
@@ -85,7 +85,16 @@ ETERM *erl_global_whereis(int fd, const char *name, char *node)
opid = erl_decode((unsigned char*)buf);
/* extract the nodename for the caller */
- if (node) strcpy(node,epid.node);
+ if (node) {
+ char* node_str = ERL_PID_NODE(opid);
+ if (node_str) {
+ strcpy(node, node_str);
+ }
+ else {
+ erl_free_term(opid);
+ return NULL;
+ }
+ }
return opid;
}