diff options
Diffstat (limited to 'manual/socket.texi')
-rw-r--r-- | manual/socket.texi | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/manual/socket.texi b/manual/socket.texi index ab94f29d85..02a50be52a 100644 --- a/manual/socket.texi +++ b/manual/socket.texi @@ -1310,6 +1310,7 @@ gethostname (char *host) int herr; hstbuflen = 1024; + /* Allocate buffer, remember to free it to avoid a memory leakage. */ tmphstbuf = malloc (hstbuflen); while ((res = gethostbyname_r (host, &hostbuf, tmphstbuf, hstbuflen, @@ -1322,7 +1323,7 @@ gethostname (char *host) /* Check for errors. */ if (res || hp == NULL) return NULL; - return hp->h_name; + return hp; @} @end smallexample @end deftypefun |