fix leak and missing return value check
authorChristian Grothoff <christian@grothoff.org>
Fri, 4 Nov 2011 13:44:54 +0000 (13:44 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 4 Nov 2011 13:44:54 +0000 (13:44 +0000)
src/transport/gnunet_wlan_sender.c

index 64a74169bfe987a773968b880b22320c3fc2e3fc..2cac02cd82c49534c00dd35144fa3522024a920f 100644 (file)
@@ -120,6 +120,7 @@ getWlanHeader (struct ieee80211_frame *Header,
 }
 
 int main(int argc, char *argv[]){
+  char msg_buf[WLAN_MTU];
        struct GNUNET_MessageHeader *msg;
        struct ieee80211_frame *wlan_header;
        struct Radiotap_Send *radiotap;
@@ -173,7 +174,7 @@ int main(int argc, char *argv[]){
                        outmac[i] = temp[i];
                }
 
-               msg = malloc(WLAN_MTU);
+               msg = (struct GNUNET_MessageHeader*) msg_buf;
                msg->type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
                msg->size = htons (WLAN_MTU);
                radiotap = (struct Radiotap_Send *) &msg[1];