bug #11387,
authorJan Pospíšil <honik@ntc.zcu.cz>
Sun, 2 Oct 2005 18:03:57 +0000 (18:03 +0000)
committerJan Pospíšil <honik@ntc.zcu.cz>
Sun, 2 Oct 2005 18:03:57 +0000 (18:03 +0000)
- added missing initialization of msg in get_reply*()

org.glite.lb.client/src/prod_proto.c
org.glite.lb.logger/src/send_event.c

index 8c6004b..97a68ea 100644 (file)
@@ -98,7 +98,7 @@ static
 int
 get_reply_plain(edg_wll_Context context, edg_wll_PlainConnection *conn, char **buf, int *code_min)
 {
-       char *msg;
+       char *msg=NULL;
        int len, code;
        struct reader_data data;
 
index 65e2c01..602fd0d 100644 (file)
@@ -130,7 +130,7 @@ static
 int 
 get_reply(struct event_queue *eq, char **buf, int *code_min)
 {
-  char *msg;
+  char *msg=NULL;
   int ret, code;
   size_t len, l;
   struct timeval tv;
@@ -141,11 +141,12 @@ get_reply(struct event_queue *eq, char **buf, int *code_min)
   data.gss = &eq->gss;
   data.timeout = &tv;
   len = read_il_data(&data, &msg, gss_reader);
-  if(len < 0) 
+  if(len < 0) {
+    set_error(IL_PROTO, LB_PROTO, "get_reply: error reading server reply");
     return(-1);
-
+  }
   ret = decode_il_reply(&code, code_min, buf, msg);
-  free(msg);
+  if(msg) free(msg);
   if(ret < 0) {
     set_error(IL_PROTO, LB_PROTO, "get_reply: error decoding server reply");
     return(-1);