IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 8, 2005, 2:02:20 PM (21 years ago)
Author:
jhoblitt
Message:

reorganize nebFindInstacnes()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/nebclient/src/nebclient.c

    r4522 r4523  
    44 * Copyright (C) 2005  Joshua Hoblitt
    55 *
    6  * $Id: nebclient.c,v 1.21 2005-07-08 22:04:05 jhoblitt Exp $
     6 * $Id: nebclient.c,v 1.22 2005-07-09 00:02:20 jhoblitt Exp $
    77 */
    88
     
    206206
    207207    // FIXME is this leaking memory when response goes out of scope?
    208     if (soap_call_ns1__find_USCOREinstances(server->soap, NULL, NULL, (char *)key, (char *)volume, &response) == SOAP_OK) {
    209 
    210         resultElements = response.result->__size;
    211         resultArray    = response.result->__ptr;
    212 
    213         loc = xmalloc(sizeof(char*) * resultElements);
    214 
    215         for (i = 0; i < resultElements; i++) {
    216             loc[i] = xmalloc(strlen(resultArray[i]) + 1);
    217 
    218             strcpy(loc[i], resultArray[i]);
    219         }
    220 
    221         *locations = loc;
    222 
    223         return resultElements;
    224     }
    225 
    226     // server error
    227     return -1;
     208    if (soap_call_ns1__find_USCOREinstances(server->soap, NULL, NULL,
     209            (char *)key, (char *)volume, &response) != SOAP_OK) {
     210        nebSetServerErr(server);
     211        return -1;
     212    }
     213
     214    resultElements = response.result->__size;
     215    resultArray    = response.result->__ptr;
     216
     217    loc = xmalloc(sizeof(char*) * resultElements);
     218
     219    for (i = 0; i < resultElements; i++) {
     220        loc[i] = xmalloc(strlen(resultArray[i]) + 1);
     221
     222        strcpy(loc[i], resultArray[i]);
     223    }
     224
     225    *locations = loc;
     226
     227    return resultElements;
    228228}
    229229
Note: See TracChangeset for help on using the changeset viewer.