Changeset 30428a9


Ignore:
Timestamp:
Jul 24, 2011, 7:05:36 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.9
Children:
8c3cae0, f271129
Parents:
40de739
git-author:
David Benjamin <davidben@mit.edu> (07/24/11 18:23:21)
git-committer:
David Benjamin <davidben@mit.edu> (07/24/11 19:05:36)
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 r30428a9  
    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.