```
Node *create_node() {
    Node node = malloc(sizeof(Node));
    node.cargo = next_free_cargo++;
    return &node;   
}

```

I thought malloc created things on the heap? Why is this still considered a local variable?

Also, is this the correct way?

```
Node *create_node() {
    Node *node = malloc(sizeof(Node*));
    node->cargo = next_free_cargo++;
    return node;    
}

```

As I read it, this creates memory for a pointer to a Node. But how does it allocate memory for the node itself?