cvs: /php4/ext/hyperwave hw.c hg_comm.c
| From: | Uwe Steinmann | Date: | Wed, 06 Oct 1999 05:31:24 +0000 |
| Subject: | cvs: /php4/ext/hyperwave hw.c hg_comm.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5220@lists.php.net to get a copy of this message | ||
steinm Wed Oct 6 01:31:24 1999 EDT
Modified files:
/php4/ext/hyperwave hw.c hg_comm.c
Log:
- fixed some memory leaks
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.21 php4/ext/hyperwave/hw.c:1.22
--- php4/ext/hyperwave/hw.c:1.21 Wed Sep 15 01:42:34 1999
+++ php4/ext/hyperwave/hw.c Wed Oct 6 01:31:22 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.21 1999/09/15 05:42:34 andi Exp $ */
+/* $Id: hw.c,v 1.22 1999/10/06 05:31:22 steinm Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -370,6 +370,12 @@
}
attrname = strtok(NULL, "\n");
+ }
+ if(NULL == sarr){
+ spec_arr->refcount--;
+ zend_hash_destroy(spec_arr->value.ht);
+ efree(spec_arr->value.ht);
+ efree(spec_arr);
}
efree(temp);
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.11 php4/ext/hyperwave/hg_comm.c:1.12
--- php4/ext/hyperwave/hg_comm.c:1.11 Wed Sep 1 02:15:45 1999
+++ php4/ext/hyperwave/hg_comm.c Wed Oct 6 01:31:23 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hg_comm.c,v 1.11 1999/09/01 06:15:45 steinm Exp $ */
+/* $Id: hg_comm.c,v 1.12 1999/10/06 05:31:23 steinm Exp $ */
/* #define HW_DEBUG */
@@ -4425,13 +4425,13 @@
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
- return(-1);
+ return(-2);
}
efree(msg.buf);
retmsg = recv_hg_msg(sockfd);
if ( retmsg == NULL ) {
- return(-1);
+ return(-3);
}
ptr = (int *) retmsg->buf;
@@ -4454,11 +4454,11 @@
if((hostptr = gethostbyname(host)) == NULL) {
php3_error(E_WARNING, "gethostbyname failed for %s", host);
/* close(fd); fd is not set yet */
- return(-1);
+ return(-4);
}
} else {
/* close(fd); fd is not set yet */
- return(-1);
+ return(-5);
}
switch(hostptr->h_addrtype) {
@@ -4476,7 +4476,7 @@
if(-1 == (fd = fnCOpenDataCon(sockfd, &port))) {
efree(msg.buf);
- return(-1);
+ return(-6);
}
/* Start building the PUTDOCUMENT message. I works even if
@@ -4487,7 +4487,7 @@
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) {
lowerror = LE_MALLOC;
- return(-1);
+ return(-7);
}
tmp = build_msg_int(msg.buf, *objectID);
@@ -4499,7 +4499,7 @@
if ( send_hg_msg(sockfd, &msg, length) == -1 ) {
efree(msg.buf);
HWSOCK_FCLOSE(fd);
- return(-1);
+ return(-8);
}
efree(msg.buf);
@@ -4509,7 +4509,7 @@
len = sizeof(serv_addr);
if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) {
HWSOCK_FCLOSE(fd);
- return(-1);
+ return(-9);
} else {
HWSOCK_FCLOSE(fd);
}
@@ -4524,13 +4524,13 @@
len = strlen(header) + 1;
if(len != write_to(newfd, header, len, wtimeout)) {
HWSOCK_FCLOSE(newfd);
- return(-1);
+ return(-10);
}
/* And now the document */
if(count != write_to(newfd, text, count, wtimeout)) {
HWSOCK_FCLOSE(newfd);
- return(-1);
+ return(-11);
}
/* The data connection has to be close before the return
@@ -4541,7 +4541,7 @@
retmsg = recv_hg_msg(sockfd);
if ( retmsg == NULL ) {
HWSOCK_FCLOSE(fd);
- return(-1);
+ return(-12);
}
ptr = (int *) retmsg->buf;
@@ -4549,7 +4549,7 @@
if(retmsg->buf) efree(retmsg->buf);
efree(retmsg);
HWSOCK_FCLOSE(fd);
- return(-1);
+ return(-13);
}
efree(retmsg->buf);