From: Lennart Poettering Date: Sun, 14 May 2006 23:39:42 +0000 (+0000) Subject: brown paperbag: actually reserve memory for our AvahiAddress before parsing data... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=a534996c7f304b219c3c3c41d97f6c20051871f2;p=catta brown paperbag: actually reserve memory for our AvahiAddress before parsing data into it. (Reported by Padraig O'Briain) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1217 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c index 6ca99d6..ac5546d 100644 --- a/avahi-client/client-test.c +++ b/avahi-client/client-test.c @@ -50,7 +50,6 @@ static void avahi_entry_group2_callback (AvahiEntryGroup *g, AvahiEntryGroupStat printf ("ENTRY-GROUP2: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata); } - static void avahi_domain_browser_callback( AvahiDomainBrowser *b, AvahiIfIndex interface, @@ -224,6 +223,7 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { int error; uint32_t cookie; struct timeval tv; + AvahiAddress a; simple_poll = avahi_simple_poll_new(); poll_api = avahi_simple_poll_get(simple_poll); @@ -287,7 +287,7 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { else printf ("Successfully created hostname resolver object\n"); - aar = avahi_address_parse ("224.0.0.251", AVAHI_PROTO_UNSPEC, aar); + aar = avahi_address_parse ("224.0.0.251", AVAHI_PROTO_UNSPEC, &a); if (aar == NULL) { printf ("failed to create address object\n"); } else {