Skip to content
Snippets Groups Projects
Commit 6373eaad authored by Julian Dieskau's avatar Julian Dieskau
Browse files

Potential Segmentation Fault fixed

If I see it right there could be a segmentation fault if used in echo mode. When you choose echo mode the variable message wouldn't a value assigned and in the cleanup function the not allocated memory would be free'ed.
parent 4a1b8067
No related branches found
No related tags found
1 merge request!22Potential segmentation fault fixed
......@@ -95,7 +95,7 @@ int fd; /* Handle for open serial port */
char* device_name = "/dev/ttymxc2"; /* String containing the device name */
struct termios termios; /* termios structure for serial port */
int bytes = 8; /* Number of bytes to be sent */
struct message *message; /* Message to be sent */
struct message *message = NULL; /* Message to be sent */
int size_of_message; /* Size of message */
char* received_data = NULL; /* Received string */
int repetitions = 1; /* Number of repetitions */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment