Hi,

I have a following protocol and coded running on Debian Jessie in C++, I 
got google protobuf library malloc error at the statement of 
Device_Interface *interface = device->add_interface();, I could not find 
any errors in following implementation. Appreciate helps to fix the malloc 
error.

    Device *device=hardware.add_device();
    device->set_name(device_name)
    device->set_devicetype(device_type);
    for (auto local_interface = local_device.interfaces()) {
        Device_Interface *interface = device->add_interface();  // Caused 
segmentation malloc error???
        interface->set_name(local_interface.name());
        ......
    }
    


message Hardware {
    repeated Device device = 1;
}

message Device { 
    required string name = 1;
    required string deviceType = 2;
    repeated Interface interface = 3;

    message Interface {
         required string name = 1;
         required string type = 2;  
    }
}


-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to