IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2006, 10:28:33 AM (20 years ago)
Author:
eugene
Message:

squashing queue leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/queues.c

    r9280 r9359  
    141141}
    142142
     143// return a newly allocated string containing the requested key value
    143144char *ChooseSingleKey (char *line, int Key) {
    144145
     
    146147  char *key, *p;
    147148
     149  if (Key == -1) {
     150    key = strcreate (line);
     151    return (key);
     152  }
     153
    148154  key = line;
    149   if (Key == -1) return line;
    150 
    151155  for (i = 0; (i < Key) && (key != NULL); i++) {
    152156    p = nextword (key);
     
    192196    first = FALSE;
    193197  }
    194 
    195198  return (output);
    196199}
     
    337340      test = ChooseKey (queue[0].lines[i], Key);
    338341      if (test == NULL) continue;
    339       if (strcmp (value, test)) continue;
     342      if (strcmp (value, test)) {
     343        free (test);
     344        continue;
     345      }
     346      free (test);
    340347      choice = i;
    341348  }
Note: See TracChangeset for help on using the changeset viewer.