mturk       2005/03/14 22:04:58

  Modified:    jk/native/common jk_status.c
  Log:
  No need to strdup param that already uses stack buffer.
  
  Revision  Changes    Path
  1.32      +11 -17    jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_status.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- jk_status.c       14 Mar 2005 20:41:09 -0000      1.31
  +++ jk_status.c       15 Mar 2005 06:04:58 -0000      1.32
  @@ -758,23 +758,17 @@
   
   static int status_mime_type(const char *req)
   {
  -    if (!req)
  -        return 0;
  -    else {
  -        char buf[32];
  -        char *mimetype = NULL;
  -        int ret = 0 ;
  -        if(status_cmd("mime", req, buf, sizeof(buf)) != NULL) {
  -            mimetype = strdup(buf) ;
  -                 if (!strncmp(mimetype, "xml", 3))
  -                     ret = 1;
  -                 else if (!strncmp(mimetype, "txt", 3))
  -                     ret = 2;
  +    int ret = 0 ;
  +    if (req) {
  +        char mimetype[32];
  +        if (status_cmd("mime", req, mimetype, sizeof(mimetype)) != NULL) {
  +            if (!strcmp(mimetype, "xml"))
  +                ret = 1;
  +            else if (!strcmp(mimetype, "txt"))
  +                ret = 2;
           }
  -        if (mimetype)
  -            free(mimetype);
  -        return ret ;
       }
  +    return ret ;
   }
   
   static int JK_METHOD service(jk_endpoint_t *e,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to