components/avahi/patches/16-memory-crash.patch
changeset 5257 0da26ce015ab
equal deleted inserted replaced
5256:1c3e20e70cc3 5257:0da26ce015ab
       
     1 Source: Desktop consolidation
       
     2 Patch Comment: type:bug bugster:6804284
       
     3 
       
     4 --- avahi-0.6.30/avahi-utils/stdb.c.orig	2011-06-08 10:28:42.651208301 +0100
       
     5 +++ avahi-0.6.30/avahi-utils/stdb.c	2011-06-08 10:32:25.750739026 +0100
       
     6 @@ -136,8 +136,9 @@
       
     7  
       
     8      avahi_free(buffer);
       
     9      buffer = avahi_strndup(data.dptr, data.dsize);
       
    10 +#ifdef HAVE_GDBM
       
    11      free(data.dptr);
       
    12 -
       
    13 +#endif
       
    14      return buffer;
       
    15  
       
    16  fail:
       
    17 @@ -199,7 +200,9 @@
       
    18              return NULL;
       
    19  
       
    20          enum_key = avahi_strndup(key.dptr, key.dsize);
       
    21 +#ifdef HAVE_GDBM
       
    22          free(key.dptr);
       
    23 +#endif
       
    24  
       
    25          if (!strchr(enum_key, '['))
       
    26              return enum_key;