PR_FREEIF(buffer);
COOKIE_GetPermissionListForViewer(nsString& aPermissionList, PRInt32 type) {  char *buffer = (char*)PR_Malloc(BUFLEN2);  int g = 0, permissionNum;  permission_HostStruct * hostStruct;  permission_TypeStruct * typeStruct;  buffer[0] = '\0';  permissionNum = 0;  if (cookie_permissionList == nsnull) {    PR_FREEIF(buffer);    return;  }  PRInt32 count = cookie_permissionList->Count();  for (PRInt32 i = 0; i < count; ++i) {    hostStruct = NS_STATIC_CAST(permission_HostStruct*, cookie_permissionList->ElementAt(i));    if (hostStruct) {      PRInt32 count2 = hostStruct->permissionList->Count();      for (PRInt32 typeIndex=0; typeIndex<count2; typeIndex++) {        typeStruct = NS_STATIC_CAST          (permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeIndex));        if (typeStruct->type == type) {          g += PR_snprintf(buffer+g, BUFLEN2-g,            "%c%d%c%c%s",            BREAK,            permissionNum,            BREAK,            (typeStruct->permission) ? '+' : '-',            hostStruct->host          );          permissionNum++;        }      }    }  }  aPermissionList.AssignWithConversion(buffer);  PR_FREEIF(buffer);}