var: adjust memory allocation for strings
commitcdd489eaf9cd3c46c30b485601e2bcb989586274
authorbrian m. carlson <bk2204@github.com>
Tue, 27 Jun 2023 16:18:59 +0000 (27 16:18 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Jun 2023 18:31:06 +0000 (27 11:31 -0700)
treede83eb71fffaf29491ab439c39d0871e0873850d
parentf74c90dcf7ed8ef7994ab583de089dba2a2b1a22
var: adjust memory allocation for strings

Right now, all of our values are constants whose allocation is managed
elsewhere.  However, in the future, we'll have some variables whose
memory we will need to free.  To keep things consistent, let's make each
of our functions allocate its own memory and make the caller responsible
for freeing it.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/var.c