Permalink
Browse files

Don't use pointer after freeing w/o explicit setting to NULL.

  • Loading branch information...
1 parent afdd3a5 commit b8c1e42d7875ef6ae9d88e95e3a678ea76461ce4 @Cizzle Cizzle committed with vanosg Feb 17, 2017
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/patch.h
  2. +3 −3 src/userent.c
View
@@ -39,12 +39,12 @@ patch("Git"); /* Git version */
*
*
*/
-patch("1486953801"); /* current unixtime */
+patch("1487315655"); /* current unixtime */
/*
*
*
*/
-patch("cleancompile");
+patch("cov-fixes");
/*
*
*
View
@@ -775,10 +775,10 @@ int xtra_set(struct userrec *u, struct user_entry *e, void *buf)
egg_list_delete(&e->u.list, (struct list_type *) old);
nfree(old->key);
nfree(old->data);
- nfree(old);
- if (old == e->u.extra) {
+ if (old == e->u.extra)
e->u.extra = NULL;
- }
+ nfree(old);
+ old = NULL;
}
/* don't do anything when old == new */
if (old != new) {

0 comments on commit b8c1e42

Please sign in to comment.