Ticket #24: jack.diff

File jack.diff, 1.1 KB (added by leland_lucius, 2 years ago)
  • pa_jack.c

    old new  
    466466 
    467467    const char **jack_ports = NULL; 
    468468    char **client_names = NULL; 
    469     char *regex_pattern = MALLOC( jack_client_name_size() + 3 ); 
     469    char *regex_pattern = NULL; 
    470470    int port_index, client_index, i; 
    471471    double globalSampleRate; 
    472472    regex_t port_regex; 
    473473    unsigned long numClients = 0, numPorts = 0; 
    474     char *tmp_client_name = MALLOC( jack_client_name_size() ); 
     474    char *tmp_client_name = NULL; 
    475475 
    476476    commonApi->info.defaultInputDevice = paNoDevice; 
    477477    commonApi->info.defaultOutputDevice = paNoDevice; 
     
    484484     * associated with the previous list */ 
    485485    PaUtil_FreeAllAllocations( jackApi->deviceInfoMemory ); 
    486486 
     487    regex_pattern = MALLOC( jack_client_name_size() + 3 ); 
     488    tmp_client_name = MALLOC( jack_client_name_size() ); 
     489 
    487490    /* We can only retrieve the list of clients indirectly, by first 
    488491     * asking for a list of all ports, then parsing the port names 
    489492     * according to the client_name:port_name convention (which is