Changeset 15a7aee for functions.c


Ignore:
Timestamp:
Jul 24, 2011, 6:23:21 PM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Children:
2323e49
Parents:
7abfcf2
Message:
Fix missing NULL check on anyone list return value

Error handling changed in ecffae6c5b3fd57d8ca74cd2ba142098748bfe7c.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r287c634 r15a7aee  
    34803480
    34813481  anyone = owl_zephyr_get_anyone_list(NULL);
    3482   for (i = 0; i < anyone->len; i++) {
    3483     user = anyone->pdata[i];
    3484     zald = g_new(ZAsyncLocateData_t, 1);
    3485     if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) {
    3486       *zaldlist = g_list_append(*zaldlist, zald);
    3487     } else {
    3488       g_free(zald);
    3489     }
    3490   }
    3491 
    3492   owl_ptr_array_free(anyone, g_free);
     3482  if (anyone != NULL) {
     3483    for (i = 0; i < anyone->len; i++) {
     3484      user = anyone->pdata[i];
     3485      zald = g_new(ZAsyncLocateData_t, 1);
     3486      if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) {
     3487        *zaldlist = g_list_append(*zaldlist, zald);
     3488      } else {
     3489        g_free(zald);
     3490      }
     3491    }
     3492    owl_ptr_array_free(anyone, g_free);
     3493  }
    34933494#endif
    34943495}
Note: See TracChangeset for help on using the changeset viewer.