Skip to content

Commit 601017b

Browse files
[Warnings] Fixed Potential Memory Leak
This line of code was likely a mistake; the src of a strcpy should never be a freshly allocated pointer. Fixed the line to likely what the coder intended.
1 parent 01ace7a commit 601017b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/libvqm/vqm_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ void add_node(char* type, char *name, t_array_ref **ports, t_parse_info* parse_i
559559
new_assoc->associated_net = net;
560560
new_assoc->port_index = counter;
561561
new_assoc->port_name = (char *) malloc(strlen(association->port_name)+1);
562-
strcpy(new_assoc->port_name, (char*)malloc(strlen(association->port_name)));
562+
strcpy(new_assoc->port_name, association->port_name);
563563
new_assoc->wire_index = wire_index;
564564
wire_index += change;
565565
m_ports->array_size = insert_element_at_index((intptr_t) new_assoc, m_ports, counter);

0 commit comments

Comments
 (0)