Fix an obscure memory leak and fix formatting.
This patch fixes an obscure memory leak and make the formatting
of these two routines match the rest of the code in the file.
(cherry picked from commit 7866e92761)
This commit is contained in:
parent
8fc049eefd
commit
c337b0ef0c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
|
|
@ -111,7 +111,10 @@ char *generic_get_str(int code, vpiHandle ref, const char *name, const char *ind
|
|||
if (index != NULL) len += strlen(index) + 2; /* include space for brackets */
|
||||
|
||||
char *res = need_result_buf(len, RBUF_STR);
|
||||
if (!res) return NULL;
|
||||
if (!res) {
|
||||
free(bn);
|
||||
return NULL;
|
||||
}
|
||||
*res=0; /* start with nothing */
|
||||
|
||||
/* if this works, I can make it more efficient later */
|
||||
|
|
|
|||
Loading…
Reference in New Issue