From: Benjamin Otte Date: Mon, 17 Aug 2009 17:29:17 +0000 (+0200) Subject: Add warning in a "can't happen" case X-Git-Tag: LIBSOUP_2_27_91~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=373d0a5508a0f8edd93a784899f805f6352d227b;p=platform%2Fupstream%2Flibsoup.git Add warning in a "can't happen" case This is mostly to indicate that we did not forget error checking. --- diff --git a/libsoup/soup-address.c b/libsoup/soup-address.c index 043bac2..0aa0547 100644 --- a/libsoup/soup-address.c +++ b/libsoup/soup-address.c @@ -566,7 +566,11 @@ update_addrs (SoupAddress *addr, GList *addrs, GError *error) len = g_socket_address_get_native_size (gsa); priv->sockaddr = g_malloc (len); - g_socket_address_to_native (gsa, priv->sockaddr, len, NULL); + if (!g_socket_address_to_native (gsa, priv->sockaddr, len, NULL)) { + /* can't happen: We know the address format is supported + * and the buffer is large enough */ + g_warn_if_reached (); + } return SOUP_STATUS_OK; }