Update of /cvsroot/monetdb/pathfinder/runtime
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31160/runtime
Modified Files:
Tag: M5XQ
xrpc_client.mx
Log Message:
propagated changes of Monday Jan 04 2010
from the XQFT branch to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2010/01/04 - sjoerd: runtime/xrpc_client.mx,1.56.4.3
propagated changes of Saturday Dec 26 2009 - Monday Jan 04 2010
from the development trunk to the XQFT branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/12/26 - stmane: runtime/xrpc_client.mx,1.59
propagated changes of Wednesday Dec 23 2009 - Saturday Dec 26 2009
from the Nov2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/12/23 - sjoerd: runtime/xrpc_client.mx,1.56.2.4
Always free resp on error.
Found by Coverity.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/12/24 - stmane: runtime/xrpc_client.mx,1.56.2.5
fixing compilation with icc:
.../pathfinder/runtime/xrpc_client.mx(737): error #589: transfer of
control bypasses initialization of:
variable "time_xrpcClntDeSeria" (declared at line 791)
goto error;
^
[...]
.../pathfinder/runtime/xrpc_client.mx(787): error #589: transfer of
control bypasses initialization of:
variable "time_xrpcClntDeSeria" (declared at line 791)
goto error;
^
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: xrpc_client.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_client.mx,v
retrieving revision 1.55.4.3
retrieving revision 1.55.4.4
diff -u -d -r1.55.4.3 -r1.55.4.4
--- xrpc_client.mx 9 Dec 2009 14:26:08 -0000 1.55.4.3
+++ xrpc_client.mx 4 Jan 2010 15:22:09 -0000 1.55.4.4
@@ -724,6 +724,7 @@
int port,
bool updCall)
{
+ lng time_xrpcClntDeSeria = 0;
char respStatus[1024];
int ret;
buffer *resp;
@@ -734,15 +735,12 @@
resp = buffer_create(MAX_BUF_SIZE);
if (!resp || resp->len == 0) {
GDKerror("response2bat: failed to create buffer for XRPC response
message\n");
- if (resp)
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
if( !(ret = stream_readline(in, respStatus, 1024)) ){
GDKerror("response2bat: failed to receive response from %s:%d", host,
port);
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
/* We only speak HTTP/1.1 */
@@ -758,8 +756,7 @@
GDKerror("%s\n", respStatus);
ret = stream_readline(in, respStatus, 1024);
} while (ret > 0);
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
respStatus[ret -2] = '\0';
@@ -770,8 +767,7 @@
} while (ret > 0);
if (ret < 0) {
GDKerror("response2bat: failed to receive response from %s:%d", host,
port);
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
/* Now, we can check the response status */
@@ -785,27 +781,24 @@
} while (ret > 0);
if (ret < 0) {
GDKerror("response2bat: failed to receive response from %s:%d",
host, port);
- return NULL;
+ goto error;
}
resp->buf[resp->pos] = 0;
handle_error_msg(resp->buf);
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
/* Start timing Client DeSerialisation */
- lng time_xrpcClntDeSeria = GDKusec();
+ time_xrpcClntDeSeria = GDKusec();
if (!(shredBAT = BATnew(TYPE_str, TYPE_bat, 32))){
GDKerror("response2bat: failed to malloc shredBAT\n");
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
if(shred(shredBAT, NULL, NULL, in, 0, NULL, NULL, NULL) ==GDK_FAIL) {
GDKerror("response2bat: invalid XRPC response received\n");
BBPreclaim(shredBAT);
- buffer_destroy(resp);
- return NULL;
+ goto error;
}
/* Stop timing Client DeSerialisation */
time_xrpcClntDeSeria = GDKusec() - time_xrpcClntDeSeria;
@@ -816,6 +809,10 @@
}
return shredBAT;
+ error:
+ if (resp)
+ buffer_destroy(resp);
+ return NULL;
}
static buffer *
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins